Fix clippy::needless_borrow lint violations (#36444)
Release Notes: - N/A
This commit is contained in:
parent
eecf142f06
commit
9e0e233319
242 changed files with 801 additions and 821 deletions
|
@ -520,7 +520,7 @@ async fn judge_example(
|
|||
enable_telemetry: bool,
|
||||
cx: &AsyncApp,
|
||||
) -> JudgeOutput {
|
||||
let judge_output = example.judge(model.clone(), &run_output, cx).await;
|
||||
let judge_output = example.judge(model.clone(), run_output, cx).await;
|
||||
|
||||
if enable_telemetry {
|
||||
telemetry::event!(
|
||||
|
|
|
@ -64,7 +64,7 @@ impl ExampleMetadata {
|
|||
self.url
|
||||
.split('/')
|
||||
.next_back()
|
||||
.unwrap_or(&"")
|
||||
.unwrap_or("")
|
||||
.trim_end_matches(".git")
|
||||
.into()
|
||||
}
|
||||
|
@ -255,7 +255,7 @@ impl ExampleContext {
|
|||
thread.update(cx, |thread, _cx| {
|
||||
if let Some(tool_use) = pending_tool_use {
|
||||
let mut tool_metrics = tool_metrics.lock().unwrap();
|
||||
if let Some(tool_result) = thread.tool_result(&tool_use_id) {
|
||||
if let Some(tool_result) = thread.tool_result(tool_use_id) {
|
||||
let message = if tool_result.is_error {
|
||||
format!("✖︎ {}", tool_use.name)
|
||||
} else {
|
||||
|
|
|
@ -459,8 +459,8 @@ impl ExampleInstance {
|
|||
let mut output_file =
|
||||
File::create(self.run_directory.join("judge.md")).expect("failed to create judge.md");
|
||||
|
||||
let diff_task = self.judge_diff(model.clone(), &run_output, cx);
|
||||
let thread_task = self.judge_thread(model.clone(), &run_output, cx);
|
||||
let diff_task = self.judge_diff(model.clone(), run_output, cx);
|
||||
let thread_task = self.judge_thread(model.clone(), run_output, cx);
|
||||
|
||||
let (diff_result, thread_result) = futures::join!(diff_task, thread_task);
|
||||
|
||||
|
@ -661,7 +661,7 @@ pub fn wait_for_lang_server(
|
|||
.update(cx, |buffer, cx| {
|
||||
lsp_store.update(cx, |lsp_store, cx| {
|
||||
lsp_store
|
||||
.language_servers_for_local_buffer(&buffer, cx)
|
||||
.language_servers_for_local_buffer(buffer, cx)
|
||||
.next()
|
||||
.is_some()
|
||||
})
|
||||
|
@ -693,7 +693,7 @@ pub fn wait_for_lang_server(
|
|||
_ => {}
|
||||
}
|
||||
}),
|
||||
cx.subscribe(&project, {
|
||||
cx.subscribe(project, {
|
||||
let buffer = buffer.clone();
|
||||
move |project, event, cx| match event {
|
||||
project::Event::LanguageServerAdded(_, _, _) => {
|
||||
|
@ -838,7 +838,7 @@ fn messages_to_markdown<'a>(message_iter: impl IntoIterator<Item = &'a Message>)
|
|||
for segment in &message.segments {
|
||||
match segment {
|
||||
MessageSegment::Text(text) => {
|
||||
messages.push_str(&text);
|
||||
messages.push_str(text);
|
||||
messages.push_str("\n\n");
|
||||
}
|
||||
MessageSegment::Thinking { text, signature } => {
|
||||
|
@ -846,7 +846,7 @@ fn messages_to_markdown<'a>(message_iter: impl IntoIterator<Item = &'a Message>)
|
|||
if let Some(sig) = signature {
|
||||
messages.push_str(&format!("Signature: {}\n\n", sig));
|
||||
}
|
||||
messages.push_str(&text);
|
||||
messages.push_str(text);
|
||||
messages.push_str("\n");
|
||||
}
|
||||
MessageSegment::RedactedThinking(items) => {
|
||||
|
@ -878,7 +878,7 @@ pub async fn send_language_model_request(
|
|||
request: LanguageModelRequest,
|
||||
cx: &AsyncApp,
|
||||
) -> anyhow::Result<String> {
|
||||
match model.stream_completion_text(request, &cx).await {
|
||||
match model.stream_completion_text(request, cx).await {
|
||||
Ok(mut stream) => {
|
||||
let mut full_response = String::new();
|
||||
while let Some(chunk_result) = stream.stream.next().await {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue