blob: ed9178c66ab80bb0afcdf694ed39d1769d772737 [file] [log] [blame]
/// Return the first member of `prefs` that appears in `avail`.
pub fn first_in_both<T: Clone + PartialEq>(prefs: &[T], avail: &[T]) -> Option<T> {
for p in prefs {
if avail.contains(p) {
return Some(p.clone());
}
}
None
}