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
|
||
---|---|---|
.. | ||
assert | ||
bench | ||
config | ||
core | ||
dirs | ||
dt | ||
formats | ||
help | ||
input | ||
iter | ||
log | ||
math | ||
util | ||
xml | ||
mod.nu |