nushell/crates/nu-std/std
Bahex cfdb4bbf25
std/iter scan: change closure signature to be consistent with reduce (#14596)
# 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
2024-12-16 06:13:51 -06:00
..
assert Virtual std module subdirectories (#14040) 2024-10-10 06:56:37 -05:00
bench Virtual std module subdirectories (#14040) 2024-10-10 06:56:37 -05:00
config Remove unused FlatShapes And/Or (#14476) 2024-11-29 22:23:40 +01:00
core Respect use_ansi_coloring setting in banner (#14049) 2024-10-10 09:58:37 -05:00
dirs Fix small typos in std/dirs (#14422) 2024-11-23 16:04:27 -06:00
dt Deprecate date to-record and date to-table (#14319) 2024-11-29 23:06:26 +01:00
formats fix multiline strings in NDNUON (#14519) 2024-12-05 07:53:33 -06:00
help make std help more user friendly (#14347) 2024-11-27 09:29:25 +08:00
input Virtual std module subdirectories (#14040) 2024-10-10 06:56:37 -05:00
iter std/iter scan: change closure signature to be consistent with reduce (#14596) 2024-12-16 06:13:51 -06:00
log Virtual std module subdirectories (#14040) 2024-10-10 06:56:37 -05:00
math Virtual std module subdirectories (#14040) 2024-10-10 06:56:37 -05:00
util Virtual std module subdirectories (#14040) 2024-10-10 06:56:37 -05:00
xml Virtual std module subdirectories (#14040) 2024-10-10 06:56:37 -05:00
mod.nu Always load default env/config values (#14249) 2024-11-20 16:15:15 -06:00