From 85e6bc94e980bd91a69ef2ed5cb0372cc4e35667 Mon Sep 17 00:00:00 2001 From: Kirpal Grewal <45569241+KGrewal1@users.noreply.github.com> Date: Thu, 7 Mar 2024 16:30:40 +0000 Subject: [PATCH] Enable `clippy::suspicious_to_owned` (#9004) Another small change: calling to owned on the `Cow` was cloning the `Cow`, not its contents and so calling `clone` makes this more explicit --- Cargo.toml | 1 - crates/workspace/src/workspace.rs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 963901d40d6329ff4fc3479cc934332276e93fbe..f9b5cb3881309a1bcb9a50edbb554f84fbdbb71c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -400,7 +400,6 @@ non_canonical_clone_impl = "allow" non_canonical_partial_ord_impl = "allow" reversed_empty_ranges = "allow" single_range_in_vec_init = "allow" -suspicious_to_owned = "allow" type_complexity = "allow" [workspace.metadata.cargo-machete] diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index ffec512c1a87bacda08a4007e4b5c73e84a2da5a..71ba6127e961ef8ae3b60a28cf57e04e0106a312 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -224,7 +224,7 @@ impl Clone for Toast { fn clone(&self) -> Self { Toast { id: self.id, - msg: self.msg.to_owned(), + msg: self.msg.clone(), on_click: self.on_click.clone(), } }