diff --git a/Cargo.toml b/Cargo.toml index f7c57201..c719dbd6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,7 @@ float_cmp_const = "warn" format_push_string = "warn" get_unwrap = "warn" if_then_some_else_none = "warn" +impl_trait_in_params = "warn" lossy_float_literal = "warn" mem_forget = "warn" mod_module_files = "warn" diff --git a/src/utils.rs b/src/utils.rs index 530f1886..4b2d7c3f 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -81,10 +81,15 @@ pub(crate) fn calculate_hash(keys: &[&[u8]]) -> Vec { hash.as_ref().to_owned() } -pub(crate) fn common_elements( - mut iterators: impl Iterator>>, - check_order: impl Fn(&[u8], &[u8]) -> Ordering, -) -> Option>> { +pub(crate) fn common_elements( + mut iterators: I, + check_order: F, +) -> Option>> +where + I: Iterator, + I::Item: Iterator>, + F: Fn(&[u8], &[u8]) -> Ordering, +{ let first_iterator = iterators.next()?; let mut other_iterators = iterators.map(|i| i.peekable()).collect::>();