diff --git a/crates/agent/src/thread.rs b/crates/agent/src/thread.rs index a65eda5b40..93b9a73d94 100644 --- a/crates/agent/src/thread.rs +++ b/crates/agent/src/thread.rs @@ -2241,7 +2241,7 @@ impl Thread { .read(cx) .enabled_tools(cx) .iter() - .map(|tool| tool.name().to_string()) + .map(|tool| tool.name()) .collect(); self.message_feedback.insert(message_id, feedback); diff --git a/crates/agent/src/thread_store.rs b/crates/agent/src/thread_store.rs index 99ecd3d442..508ddfa051 100644 --- a/crates/agent/src/thread_store.rs +++ b/crates/agent/src/thread_store.rs @@ -486,8 +486,8 @@ impl ThreadStore { ToolSource::Native, &profile .tools - .iter() - .filter_map(|(tool, enabled)| enabled.then(|| tool.clone())) + .into_iter() + .filter_map(|(tool, enabled)| enabled.then(|| tool)) .collect::>(), cx, ); @@ -511,32 +511,32 @@ impl ThreadStore { }); } // Enable all the tools from all context servers, but disable the ones that are explicitly disabled - for (context_server_id, preset) in &profile.context_servers { + for (context_server_id, preset) in profile.context_servers { self.tools.update(cx, |tools, cx| { tools.disable( ToolSource::ContextServer { - id: context_server_id.clone().into(), + id: context_server_id.into(), }, &preset .tools - .iter() - .filter_map(|(tool, enabled)| (!enabled).then(|| tool.clone())) + .into_iter() + .filter_map(|(tool, enabled)| (!enabled).then(|| tool)) .collect::>(), cx, ) }) } } else { - for (context_server_id, preset) in &profile.context_servers { + for (context_server_id, preset) in profile.context_servers { self.tools.update(cx, |tools, cx| { tools.enable( ToolSource::ContextServer { - id: context_server_id.clone().into(), + id: context_server_id.into(), }, &preset .tools - .iter() - .filter_map(|(tool, enabled)| enabled.then(|| tool.clone())) + .into_iter() + .filter_map(|(tool, enabled)| enabled.then(|| tool)) .collect::>(), cx, ) diff --git a/crates/assistant_context_editor/src/slash_command.rs b/crates/assistant_context_editor/src/slash_command.rs index 1cbcb4a637..b0f16e53a7 100644 --- a/crates/assistant_context_editor/src/slash_command.rs +++ b/crates/assistant_context_editor/src/slash_command.rs @@ -278,8 +278,8 @@ impl CompletionProvider for SlashCommandCompletionProvider { buffer.anchor_after(Point::new(position.row, first_arg_start.start as u32)); let arguments = call .arguments - .iter() - .filter_map(|argument| Some(line.get(argument.clone())?.to_string())) + .into_iter() + .filter_map(|argument| Some(line.get(argument)?.to_string())) .collect::>(); let argument_range = first_arg_start..buffer_position; ( diff --git a/crates/git_ui/src/branch_picker.rs b/crates/git_ui/src/branch_picker.rs index 2530bacf8d..04c5575d1f 100644 --- a/crates/git_ui/src/branch_picker.rs +++ b/crates/git_ui/src/branch_picker.rs @@ -306,8 +306,7 @@ impl PickerDelegate for BranchListDelegate { cx.background_executor().clone(), ) .await - .iter() - .cloned() + .into_iter() .map(|candidate| BranchEntry { branch: all_branches[candidate.candidate_id].clone(), positions: candidate.positions, diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index 738e0f62a3..03acd514a1 100644 --- a/crates/git_ui/src/git_panel.rs +++ b/crates/git_ui/src/git_panel.rs @@ -1051,8 +1051,8 @@ impl GitPanel { repo.checkout_files( "HEAD", entries - .iter() - .map(|entries| entries.repo_path.clone()) + .into_iter() + .map(|entries| entries.repo_path) .collect(), cx, ) diff --git a/crates/inline_completion_button/src/inline_completion_button.rs b/crates/inline_completion_button/src/inline_completion_button.rs index 296b169950..fd25823307 100644 --- a/crates/inline_completion_button/src/inline_completion_button.rs +++ b/crates/inline_completion_button/src/inline_completion_button.rs @@ -857,7 +857,7 @@ async fn open_disabled_globs_setting_in_editor( }); if !edits.is_empty() { - item.edit(edits.iter().cloned(), cx); + item.edit(edits, cx); } let text = item.buffer().read(cx).snapshot(cx).text(); diff --git a/crates/language_tools/src/lsp_log.rs b/crates/language_tools/src/lsp_log.rs index 8b29ab6298..9c124599b2 100644 --- a/crates/language_tools/src/lsp_log.rs +++ b/crates/language_tools/src/lsp_log.rs @@ -1238,12 +1238,12 @@ impl Render for LspLogToolbarItemView { } }); let available_language_servers: Vec<_> = menu_rows - .iter() + .into_iter() .map(|row| { ( row.server_id, - row.server_name.clone(), - row.worktree_root_name.clone(), + row.server_name, + row.worktree_root_name, row.selected_entry, ) }) diff --git a/crates/project/src/git_store.rs b/crates/project/src/git_store.rs index d00f0a41fd..5d6fcdb503 100644 --- a/crates/project/src/git_store.rs +++ b/crates/project/src/git_store.rs @@ -4278,9 +4278,9 @@ impl Repository { })); } let mut cursor = prev_statuses.cursor::(&()); - for path in changed_paths.iter() { + for path in changed_paths.into_iter() { if cursor.seek_forward(&PathTarget::Path(&path), Bias::Left, &()) { - changed_path_statuses.push(Edit::Remove(PathKey(path.0.clone()))); + changed_path_statuses.push(Edit::Remove(PathKey(path.0))); } } changed_path_statuses