Enable clippy::unnecessary_to_owned lint

Meh
This commit is contained in:
Johannes Altmanninger 2024-01-13 02:08:34 +01:00
parent 65064ac976
commit fd7f76c180
5 changed files with 3 additions and 2 deletions

View file

@ -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"

View file

@ -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());
}

View file

@ -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<WString> = 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());
}

View file

@ -1680,6 +1680,7 @@ impl History {
cancel_check,
);
} else {
#[allow(clippy::unnecessary_to_owned)]
for search_string in search_args.iter().copied() {
if search_string.is_empty() {
streams

View file

@ -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") {