Raise MSRV to 1.95 and refactor nested if-lets with let-chains#19
Merged
Conversation
Match the toolchain in use (rustc 1.95.0). Untracked _generated_flows/ and scripts/ are intentionally left out.
Use Rust 2024 let-chains (if let ... && let ...) in extract_token, merge_broker, and RangeNode::apply, removing a level of nesting. Enabled by the 1.95 toolchain.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several code cleanups and minor improvements to the project, focusing on simplifying conditional logic and updating dependencies. The main changes include updating the Rust toolchain version and refactoring conditional statements for improved readability and conciseness.
Dependency and configuration updates:
Cargo.toml: Updated therust-versionrequirement from1.85to1.95to use a newer Rust toolchain.Code readability and refactoring:
src/auth.rs: Refactored theextract_tokenfunction to use Rust's new let-else conditional (if let ... && let ...) for more concise and readable token extraction logic.src/runtime/mod.rs: Simplified the merging logic in themerge_brokerfunction by replacing nestedif letstatements with a single compound conditional using the new syntax.src/runtime/nodes/range.rs: Refactored the mapping logic inRangeNodeto use the new compound conditional syntax, improving code clarity.