mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-12-24 10:23:43 +08:00
refactor: remove unnecessary copied()
for Utf32Str reference
Some checks failed
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / macos (push) Has been cancelled
Rust checks / rustfmt (push) Has been cancelled
Rust checks / clippy (push) Has been cancelled
Rust checks / cargo-deny (push) Has been cancelled
Some checks failed
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / macos (push) Has been cancelled
Rust checks / rustfmt (push) Has been cancelled
Rust checks / clippy (push) Has been cancelled
Rust checks / cargo-deny (push) Has been cancelled
This commit is contained in:
parent
b2e6609367
commit
d124c31958
|
@ -86,12 +86,8 @@ pub fn source(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr]) -> O
|
||||||
// Construct argv from our null-terminated list.
|
// Construct argv from our null-terminated list.
|
||||||
// This is slightly subtle. If this is a bare `source` with no args then `argv + optind` already
|
// 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.
|
// 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 }..];
|
let remaining_args = &args[optind + if argc == optind { 0 } else { 1 }..];
|
||||||
#[allow(clippy::unnecessary_to_owned)]
|
let argv_list = remaining_args.iter().map(|&arg| arg.to_owned()).collect();
|
||||||
for arg in remaining_args.iter().copied() {
|
|
||||||
argv_list.push(arg.to_owned());
|
|
||||||
}
|
|
||||||
parser.vars().set_argv(argv_list);
|
parser.vars().set_argv(argv_list);
|
||||||
|
|
||||||
let mut retval = reader_read(parser, fd, streams.io_chain);
|
let mut retval = reader_read(parser, fd, streams.io_chain);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user