diff --git a/Cargo.toml b/Cargo.toml index f59c2a307..bcf658ade 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,5 +95,4 @@ clippy.ptr_arg = "allow" clippy.redundant_slicing = "allow" clippy.too_many_arguments = "allow" clippy.uninlined_format_args = "allow" -clippy.unnecessary_to_owned = "allow" clippy.unnecessary_unwrap = "allow" diff --git a/fish-rust/src/builtins/history.rs b/fish-rust/src/builtins/history.rs index b9984057d..54e326b44 100644 --- a/fish-rust/src/builtins/history.rs +++ b/fish-rust/src/builtins/history.rs @@ -309,6 +309,7 @@ pub fn history(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr]) -> )); return STATUS_INVALID_ARGS; } + #[allow(clippy::unnecessary_to_owned)] for delete_string in args.iter().copied() { history.remove(delete_string.to_owned()); } diff --git a/fish-rust/src/builtins/source.rs b/fish-rust/src/builtins/source.rs index c608df842..81cdf5e96 100644 --- a/fish-rust/src/builtins/source.rs +++ b/fish-rust/src/builtins/source.rs @@ -96,6 +96,7 @@ pub fn source(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr]) -> O // points to the end of argv. Otherwise we want to skip the file name to get to the args if any. let mut argv_list: Vec = vec![]; let remaining_args = &args[optind + if argc == optind { 0 } else { 1 }..]; + #[allow(clippy::unnecessary_to_owned)] for arg in remaining_args.iter().copied() { argv_list.push(arg.to_owned()); } diff --git a/fish-rust/src/history.rs b/fish-rust/src/history.rs index 34bfa3fda..3d00abcc7 100644 --- a/fish-rust/src/history.rs +++ b/fish-rust/src/history.rs @@ -1680,6 +1680,7 @@ pub fn search( cancel_check, ); } else { + #[allow(clippy::unnecessary_to_owned)] for search_string in search_args.iter().copied() { if search_string.is_empty() { streams diff --git a/fish-rust/src/lib.rs b/fish-rust/src/lib.rs index dab287c4a..6bee81616 100644 --- a/fish-rust/src/lib.rs +++ b/fish-rust/src/lib.rs @@ -21,7 +21,6 @@ #![allow(clippy::redundant_slicing)] #![allow(clippy::too_many_arguments)] #![allow(clippy::uninlined_format_args)] -#![allow(clippy::unnecessary_to_owned)] #![allow(clippy::unnecessary_unwrap)] pub const BUILD_VERSION: &str = match option_env!("FISH_BUILD_VERSION") {