mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
str collect
=> str join
(#6531)
* Initialize join.rs as a copy of collect.rs * Evolve StrCollect into StrJoin * Replace 'str collect' with 'str join' everywhere git ls-files | lines | par-each { |it| sed -i 's,str collect,str join,g' $it } * Deprecate 'str collect' * Revert "Deprecate 'str collect'" This reverts commit959d14203e
. * Change `str collect` help message to say that it is deprecated We cannot remove `str collect` currently (i.e. via `nu_protocol::ShellError::DeprecatedCommand` since a prominent project uses the API:b85542c31c/src/virtualenv/activation/nushell/activate.nu (L43)
This commit is contained in:
@ -64,7 +64,7 @@ fn subexpression_properly_redirects() {
|
||||
let actual = nu!(
|
||||
cwd: ".",
|
||||
r#"
|
||||
echo (nu --testbin cococo "hello") | str collect
|
||||
echo (nu --testbin cococo "hello") | str join
|
||||
"#
|
||||
);
|
||||
|
||||
@ -215,7 +215,7 @@ fn run_custom_subcommand() {
|
||||
let actual = nu!(
|
||||
cwd: ".",
|
||||
r#"
|
||||
def "str double" [x] { echo $x $x | str collect }; str double bob
|
||||
def "str double" [x] { echo $x $x | str join }; str double bob
|
||||
"#
|
||||
);
|
||||
|
||||
@ -306,7 +306,7 @@ fn run_custom_command_with_rest_other_name() {
|
||||
greeting:string,
|
||||
...names:string # All of the names
|
||||
] {
|
||||
echo $"($greeting), ($names | sort-by | str collect)"
|
||||
echo $"($greeting), ($names | sort-by | str join)"
|
||||
}
|
||||
say-hello Salutations E D C A B
|
||||
"#
|
||||
|
Reference in New Issue
Block a user