diff --git a/crates/ide/src/doc_links/intra_doc_links.rs b/crates/ide/src/doc_links/intra_doc_links.rs index d94999dddd..1df9aaae28 100644 --- a/crates/ide/src/doc_links/intra_doc_links.rs +++ b/crates/ide/src/doc_links/intra_doc_links.rs @@ -21,8 +21,7 @@ pub(super) fn parse_intra_doc_link(s: &str) -> (&str, Option) { (hir::Namespace::Values, (VALUES.0.iter(), VALUES.1.iter())), (hir::Namespace::Macros, (MACROS.0.iter(), MACROS.1.iter())), ] - .iter() - .cloned() + .into_iter() .find_map(|(ns, (mut prefixes, mut suffixes))| { if let Some(prefix) = prefixes.find(|&&prefix| { s.starts_with(prefix) @@ -42,8 +41,7 @@ pub(super) fn strip_prefixes_suffixes(s: &str) -> &str { (VALUES.0.iter(), VALUES.1.iter()), (MACROS.0.iter(), MACROS.1.iter()), ] - .iter() - .cloned() + .into_iter() .find_map(|(mut prefixes, mut suffixes)| { if let Some(prefix) = prefixes.find(|&&prefix| { s.starts_with(prefix) diff --git a/crates/ide_assists/src/handlers/expand_glob_import.rs b/crates/ide_assists/src/handlers/expand_glob_import.rs index 34eb235ce2..3abf06d588 100644 --- a/crates/ide_assists/src/handlers/expand_glob_import.rs +++ b/crates/ide_assists/src/handlers/expand_glob_import.rs @@ -226,7 +226,7 @@ fn find_imported_defs(ctx: &AssistContext, star: SyntaxToken) -> Option Some( [Direction::Prev, Direction::Next] - .iter() + .into_iter() .flat_map(|dir| { parent_use_item_syntax .siblings(dir.to_owned()) diff --git a/crates/ide_db/src/tests/sourcegen_lints.rs b/crates/ide_db/src/tests/sourcegen_lints.rs index 3c37aa6cb9..3a44fab0f8 100644 --- a/crates/ide_db/src/tests/sourcegen_lints.rs +++ b/crates/ide_db/src/tests/sourcegen_lints.rs @@ -105,7 +105,7 @@ fn generate_lint_descriptor(buf: &mut String) { fn generate_feature_descriptor(buf: &mut String, src_dir: &Path) { let mut features = ["language-features", "library-features"] - .iter() + .into_iter() .flat_map(|it| sourcegen::list_files(&src_dir.join(it))) .filter(|path| { // Get all `.md ` files diff --git a/crates/project_model/src/sysroot.rs b/crates/project_model/src/sysroot.rs index 415bc4c9b7..52750f4896 100644 --- a/crates/project_model/src/sysroot.rs +++ b/crates/project_model/src/sysroot.rs @@ -43,8 +43,7 @@ impl Sysroot { // core is added as a dependency before std in order to // mimic rustcs dependency order ["core", "alloc", "std"] - .iter() - .copied() + .into_iter() .zip(iter::repeat(true)) .chain(iter::once(("test", false))) .filter_map(move |(name, prelude)| Some((name, self.by_name(name)?, prelude))) @@ -78,7 +77,7 @@ impl Sysroot { for path in SYSROOT_CRATES.trim().lines() { let name = path.split('/').last().unwrap(); let root = [format!("{}/src/lib.rs", path), format!("lib{}/lib.rs", path)] - .iter() + .into_iter() .map(|it| sysroot.root.join(it)) .filter_map(|it| ManifestPath::try_from(it).ok()) .find(|it| fs::metadata(it).is_ok()); diff --git a/crates/rust-analyzer/tests/slow-tests/support.rs b/crates/rust-analyzer/tests/slow-tests/support.rs index 99ae418f7c..a8c2a5bb61 100644 --- a/crates/rust-analyzer/tests/slow-tests/support.rs +++ b/crates/rust-analyzer/tests/slow-tests/support.rs @@ -212,8 +212,8 @@ impl Server { if req.method == "client/registerCapability" { let params = req.params.to_string(); if ["workspace/didChangeWatchedFiles", "textDocument/didSave"] - .iter() - .any(|&it| params.contains(it)) + .into_iter() + .any(|it| params.contains(it)) { continue; }