Fix clippy::needless_borrow lint violations (#36444)

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz
2025-08-18 21:54:35 +00:00
committed by GitHub
parent eecf142f06
commit 9e0e233319
242 changed files with 801 additions and 821 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ impl LanguageModels {
for provider in &providers {
for model in provider.recommended_models(cx) {
recommended_models.insert(model.id());
recommended.push(Self::map_language_model_to_info(&model, &provider));
recommended.push(Self::map_language_model_to_info(&model, provider));
}
}
if !recommended.is_empty() {
+1 -1
View File
@@ -62,7 +62,7 @@ fn contains(
handlebars::RenderError::new("contains: missing or invalid query parameter")
})?;
if list.contains(&query) {
if list.contains(query) {
out.write("true")?;
}
+5 -5
View File
@@ -173,7 +173,7 @@ impl UserMessage {
&mut symbol_context,
"\n{}",
MarkdownCodeBlock {
tag: &codeblock_tag(&abs_path, None),
tag: &codeblock_tag(abs_path, None),
text: &content.to_string(),
}
)
@@ -189,8 +189,8 @@ impl UserMessage {
&mut rules_context,
"\n{}",
MarkdownCodeBlock {
tag: &codeblock_tag(&path, Some(line_range)),
text: &content
tag: &codeblock_tag(path, Some(line_range)),
text: content
}
)
.ok();
@@ -207,7 +207,7 @@ impl UserMessage {
"\n{}",
MarkdownCodeBlock {
tag: "",
text: &content
text: content
}
)
.ok();
@@ -1048,7 +1048,7 @@ impl Thread {
tools,
tool_choice: None,
stop: Vec::new(),
temperature: AgentSettings::temperature_for_model(&model, cx),
temperature: AgentSettings::temperature_for_model(model, cx),
thinking_allowed: true,
};
@@ -103,7 +103,7 @@ impl ContextServerRegistry {
self.reload_tools_for_server(server_id.clone(), cx);
}
ContextServerStatus::Stopped | ContextServerStatus::Error(_) => {
self.registered_servers.remove(&server_id);
self.registered_servers.remove(server_id);
cx.notify();
}
}
+1 -1
View File
@@ -471,7 +471,7 @@ fn resolve_path(
let parent_entry = parent_project_path
.as_ref()
.and_then(|path| project.entry_for_path(&path, cx))
.and_then(|path| project.entry_for_path(path, cx))
.context("Can't create file: parent directory doesn't exist")?;
anyhow::ensure!(
+1 -1
View File
@@ -80,7 +80,7 @@ impl AgentTool for TerminalTool {
let first_line = lines.next().unwrap_or_default();
let remaining_line_count = lines.count();
match remaining_line_count {
0 => MarkdownInlineCode(&first_line).to_string().into(),
0 => MarkdownInlineCode(first_line).to_string().into(),
1 => MarkdownInlineCode(&format!(
"{} - {} more line",
first_line, remaining_line_count