diff --git a/linker-diff/src/header_diff.rs b/linker-diff/src/header_diff.rs index d6fb8506..d49f277c 100644 --- a/linker-diff/src/header_diff.rs +++ b/linker-diff/src/header_diff.rs @@ -8,6 +8,7 @@ use crate::Result; use anyhow::anyhow; use anyhow::bail; use anyhow::Context as _; +use itertools::Itertools; use linker_utils::elf::shf; use linker_utils::elf::SectionFlags; use object::elf::*; @@ -223,10 +224,7 @@ pub(crate) fn diff_fields( table_name: &str, diff_mode: DiffMode, ) -> Vec { - let field_values = objects - .iter() - .map(get_fields_fn) - .collect::>>(); + let field_values = objects.iter().map(get_fields_fn).collect_vec(); if diff_mode == DiffMode::IgnoreIfAllErrors && field_values.iter().all(|d| d.is_err()) { return vec![]; } diff --git a/linker-diff/src/lib.rs b/linker-diff/src/lib.rs index 700e7599..a759b885 100644 --- a/linker-diff/src/lib.rs +++ b/linker-diff/src/lib.rs @@ -593,9 +593,7 @@ fn short_file_display_names(config: &Config) -> Result> { } names = names .iter() - .map(|name| { - String::from_utf8_lossy(&name.bytes().skip(n).collect::>()).into_owned() - }) + .map(|name| String::from_utf8_lossy(&name.bytes().skip(n).collect_vec()).into_owned()) .collect_vec(); Ok(names) } diff --git a/wild_lib/src/args.rs b/wild_lib/src/args.rs index 38c920d7..d1301ef4 100644 --- a/wild_lib/src/args.rs +++ b/wild_lib/src/args.rs @@ -619,6 +619,7 @@ mod tests { use super::IGNORED_FLAGS; use crate::args::Action; use crate::args::InputSpec; + use itertools::Itertools; use std::num::NonZeroUsize; use std::path::Path; use std::path::PathBuf; @@ -727,7 +728,7 @@ mod tests { InputSpec::File(_) => None, InputSpec::Lib(lib_name) => Some(lib_name.as_ref()), }) - .collect::>(), + .collect_vec(), &["gcc_s", "util", "rt", "pthread", "m", "dl", "c"] ); assert_contains(&args.lib_search_path, "/lib"); diff --git a/wild_lib/src/output_section_id.rs b/wild_lib/src/output_section_id.rs index e0eee32c..a48f8b26 100644 --- a/wild_lib/src/output_section_id.rs +++ b/wild_lib/src/output_section_id.rs @@ -682,7 +682,7 @@ impl<'data> OutputSectionsBuilder<'data> { } pub(crate) fn with_base_address(base_address: u64) -> Self { - let section_infos: Vec<_> = SECTION_DEFINITIONS + let section_infos = SECTION_DEFINITIONS .iter() .map(|d| SectionOutputInfo { section_flags: d.section_flags, diff --git a/wild_lib/src/symbol_db.rs b/wild_lib/src/symbol_db.rs index eddb3923..9d75a0fd 100644 --- a/wild_lib/src/symbol_db.rs +++ b/wild_lib/src/symbol_db.rs @@ -217,7 +217,7 @@ impl<'data> SymbolDb<'data> { let num_symbols_per_group = groups .iter() .map(|g| g.files.iter().map(|f| f.num_symbols()).sum()) - .collect::>(); + .collect_vec(); let num_symbols = num_symbols_per_group.iter().sum();