mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 13:23:09 +00:00
refactor: remove unnecessary copied()
for Utf32Str reference
This commit is contained in:
parent
b2e6609367
commit
d124c31958
1 changed files with 1 additions and 5 deletions
|
@ -86,12 +86,8 @@ pub fn source(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr]) -> O
|
|||
// Construct argv from our null-terminated list.
|
||||
// This is slightly subtle. If this is a bare `source` with no args then `argv + optind` already
|
||||
// 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());
|
||||
}
|
||||
let argv_list = remaining_args.iter().map(|&arg| arg.to_owned()).collect();
|
||||
parser.vars().set_argv(argv_list);
|
||||
|
||||
let mut retval = reader_read(parser, fd, streams.io_chain);
|
||||
|
|
Loading…
Reference in a new issue