enable impl_trait_in_params lint

See also <https://github.com/rust-lang/rust-clippy/issues/12792>.
This commit is contained in:
Charles Hall 2024-05-12 17:18:29 -07:00
parent 52c2893073
commit 2ded335adb
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
2 changed files with 10 additions and 4 deletions

View file

@ -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"

View file

@ -81,10 +81,15 @@ pub(crate) fn calculate_hash(keys: &[&[u8]]) -> Vec<u8> {
hash.as_ref().to_owned()
}
pub(crate) fn common_elements(
mut iterators: impl Iterator<Item = impl Iterator<Item = Vec<u8>>>,
check_order: impl Fn(&[u8], &[u8]) -> Ordering,
) -> Option<impl Iterator<Item = Vec<u8>>> {
pub(crate) fn common_elements<I, F>(
mut iterators: I,
check_order: F,
) -> Option<impl Iterator<Item = Vec<u8>>>
where
I: Iterator,
I::Item: Iterator<Item = Vec<u8>>,
F: Fn(&[u8], &[u8]) -> Ordering,
{
let first_iterator = iterators.next()?;
let mut other_iterators = iterators.map(|i| i.peekable()).collect::<Vec<_>>();