Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make reduce -n more sensible #4791

Merged
merged 1 commit into from
Mar 9, 2022
Merged

Make reduce -n more sensible #4791

merged 1 commit into from
Mar 9, 2022

Conversation

sophiajt
Copy link
Contributor

@sophiajt sophiajt commented Mar 9, 2022

Description

This slightly changes the semantics for reduce -n. Now, we don't add the index to the $acc on the way out if we're in numbered mode. This is so that the $acc variable keeps the same type through the process, which is a bit easier to read and is more predictable.

I also went ahead and made errors during reduction immediate bubble up and added ctrlc protection to the reduction.

fixes #4759

Tests

Make sure you've run and fixed any issues with these commands:

  • cargo fmt --all -- --check to check standard code formatting (cargo fmt --all applies these changes)
  • cargo clippy --all --all-features -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect to check that you're using the standard code style
  • cargo build; cargo test --all --all-features to check that all the tests pass

@sophiajt sophiajt merged commit fac086c into nushell:main Mar 9, 2022
@sophiajt sophiajt deleted the fix_4759 branch March 9, 2022 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reduce -n returns an IncompatiblePathAccess error
1 participant