mirror of
https://github.com/nushell/nushell
synced 2024-12-26 13:03:07 +00:00
cfdb4bbf25
# Description
I noticed that `std/iter scan`'s closure has the order of parameters
reversed compared to `reduce`, so changed it to be consistent.
Also it didn't have `$acc` as `$in` like `reduce`, so fixed that as
well.
# User-Facing Changes
> [!WARNING]
> This is a breaking change for all operations where order of `$it` and
`$acc` matter.
- This is still fine.
```nushell
[1 2 3] | iter scan 0 {|x, y| $x + $y}
```
- This is broken
```nushell
[a b c d] | iter scan "" {|x, y| [$x, $y] | str join} -n
```
and should be changed to either one of these
- ```nushell
[a b c d] | iter scan "" {|it, acc| [$acc, $it] | str join} -n
```
- ```nushell
[a b c d] | iter scan "" {|it| append $it | str join} -n
```
# Tests + Formatting
Only change is in the std and its tests
- 🟢 toolkit test stdlib
# After Submitting
Mention in release notes
|
||
---|---|---|
.. | ||
logger_tests | ||
test_asserts.nu | ||
test_core.nu | ||
test_dirs.nu | ||
test_dt.nu | ||
test_formats.nu | ||
test_help.nu | ||
test_iter.nu | ||
test_setup_teardown.nu | ||
test_std_formats.nu | ||
test_std_postload.nu | ||
test_std_preload.nu | ||
test_std_util.nu | ||
test_util.nu | ||
test_xml.nu |