Skip to content

use let-else syntax where possible#8886

Merged
sholderbach merged 2 commits intonushell:mainfrom
1Kinoti:let-else
Apr 14, 2023
Merged

use let-else syntax where possible#8886
sholderbach merged 2 commits intonushell:mainfrom
1Kinoti:let-else

Conversation

@1Kinoti
Copy link
Copy Markdown
Contributor

@1Kinoti 1Kinoti commented Apr 14, 2023

Description

this pr changes some if-lets to let-elses

User-Facing Changes

none

@fdncred
Copy link
Copy Markdown
Contributor

fdncred commented Apr 14, 2023

nice. i like how it starts to minimize the rightward drift of rust. I think let else was introduced in 1.65 so we should be ok with this.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 14, 2023

Codecov Report

Merging #8886 (5f141cc) into main (4a8124a) will increase coverage by 0.36%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8886      +/-   ##
==========================================
+ Coverage   68.12%   68.49%   +0.36%     
==========================================
  Files         635      635              
  Lines      101520   101512       -8     
==========================================
+ Hits        69163    69530     +367     
+ Misses      32357    31982     -375     
Impacted Files Coverage Δ
...ates/nu-cmd-lang/src/core_commands/help_aliases.rs 58.27% <100.00%> (+0.41%) ⬆️
...ates/nu-cmd-lang/src/core_commands/help_modules.rs 90.95% <100.00%> (-0.05%) ⬇️
crates/nu-cmd-lang/src/core_commands/use_.rs 83.80% <100.00%> (-0.31%) ⬇️
crates/nu-engine/src/column.rs 100.00% <100.00%> (ø)
crates/nu-parser/src/parse_keywords.rs 76.35% <100.00%> (-0.02%) ⬇️
crates/nu-parser/src/parser.rs 85.35% <100.00%> (-0.01%) ⬇️
crates/nu-protocol/src/value/range.rs 70.21% <100.00%> (-0.21%) ⬇️

... and 2 files with indirect coverage changes

Copy link
Copy Markdown
Member

@sholderbach sholderbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Makes it more readable (if you are somewhat up to date with Rust)

@sholderbach sholderbach merged commit a122e55 into nushell:main Apr 14, 2023
@1Kinoti 1Kinoti deleted the let-else branch April 15, 2023 09:17
bobhy pushed a commit to bobhy/nushell that referenced this pull request Apr 15, 2023
# Description
this pr changes some `if-let`s to `let-else`s

# User-Facing Changes
none
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.

3 participants