From 2ded335adb866e746243bbd468f45ad9f028fcb9 Mon Sep 17 00:00:00 2001 From: Charles Hall Date: Sun, 12 May 2024 17:18:29 -0700 Subject: [PATCH] enable `impl_trait_in_params` lint See also . --- Cargo.toml | 1 + src/utils.rs | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) 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::>();