From 9e66d48ccd3bb87ee97aec4e63484dc8b78e45ac Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Tue, 5 Mar 2024 14:36:53 -0500 Subject: [PATCH] Enable `clippy::cmp_owned` (#8899) This PR enables the [`clippy::cmp_owned`](https://rust-lang.github.io/rust-clippy/master/index.html#/cmp_owned) rule and fixes the outstanding violations. Release Notes: - N/A --- Cargo.toml | 1 - crates/assistant/src/assistant_panel.rs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 55f8980115..c1102dec92 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -373,7 +373,6 @@ arc_with_non_send_sync = "allow" await_holding_lock = "allow" borrowed_box = "allow" cast_abs_to_unsigned = "allow" -cmp_owned = "allow" derive_ord_xor_partial_ord = "allow" eq_op = "allow" implied_bounds_in_impls = "allow" diff --git a/crates/assistant/src/assistant_panel.rs b/crates/assistant/src/assistant_panel.rs index 97f0bca083..28623ea8b1 100644 --- a/crates/assistant/src/assistant_panel.rs +++ b/crates/assistant/src/assistant_panel.rs @@ -652,7 +652,7 @@ impl AssistantPanel { // If Markdown or No Language is Known, increase the randomness for more creative output // If Code, decrease temperature to get more deterministic outputs let temperature = if let Some(language) = language_name.clone() { - if language.to_string() != "Markdown".to_string() { + if *language != *"Markdown" { 0.5 } else { 1.0