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 commit 959d14203e.

* 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:
Dan Davison
2022-09-11 04:48:27 -04:00
committed by GitHub
parent 9ee4086dfa
commit 4926865c4e
29 changed files with 173 additions and 68 deletions

View File

@ -25,7 +25,7 @@ fn counter_clockwise() {
]
| where column0 == EXPECTED
| get column1 column2 column3
| str collect "-"
| str join "-"
"#,
));
@ -35,7 +35,7 @@ fn counter_clockwise() {
rotate --ccw
| where column0 == EXPECTED
| get column1 column2 column3
| str collect "-"
| str join "-"
"#)));
assert_eq!(actual.out, expected.out);
@ -66,7 +66,7 @@ fn clockwise() {
]
| where column3 == EXPECTED
| get column0 column1 column2
| str collect "-"
| str join "-"
"#,
));
@ -76,7 +76,7 @@ fn clockwise() {
rotate
| where column3 == EXPECTED
| get column0 column1 column2
| str collect "-"
| str join "-"
"#)));
assert_eq!(actual.out, expected.out);