rustls/rustls/src/util.rs

11 lines
264 B
Rust

/// 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
}