mirror of
https://github.com/nushell/nushell
synced 2024-11-15 17:27:58 +00:00
585ab56ea4
# Description Fixes: #7404 Fixes: #7402 ## About change In `eval_block`, all pipelines(or called statements?) result will be printed except the last one, the last one is returned by `eval_block` function. So if we want to print the last statement in eval block, we just need to print that value. # User-Facing Changes ### for ``` ❯ for _ in 1..2 { echo "a" } a a ``` ### while ``` ❯ mut x = 1; while $x < 3 { $x = $x + 1; echo bb; } bb bb ``` ### loop ``` ❯ mut total = 0; loop { ∙ if $total > 1 { ∙ break ∙ } else { ∙ $total += 1 ∙ } ∙ echo 3 ∙ } 3 3 ``` # Tests + Formatting Don't forget to add tests that cover your changes. 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 --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass # After Submitting If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. |
||
---|---|---|
.. | ||
assets | ||
proptest-regressions/format_conversions | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml | ||
LICENSE |