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

Fix clippy warning for result? #362

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

thedavemarshall
Copy link
Contributor

A few dependabot PRs (#361 , #360 , and #359 ) are failing with a clippy error when running CI for the java bindings.

This fix is to change the explicit error checking on result to instead use the rust idiomatic ? operator.

error: this `match` expression can be replaced with `?`
    --> src/interpreter.rs:2973:22
     |
2973 |           let result = match result {
     |  ______________________^
2974 | |             Ok(r) => r,
2975 | |             Err(e) => return Err(e),
2976 | |         };
     | |_________^ help: try instead: `result?`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
     = note: `-D clippy::question-mark` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::question_mark)]`

error: could not compile `regorus` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `regorus` (lib test) due to 1 previous error
Error: Process completed with exit code 101.

Copy link
Collaborator

@anakrish anakrish left a comment

Choose a reason for hiding this comment

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

LGTM

@anakrish
Copy link
Collaborator

@thedavemarshall Thanks for the fix to help unblock the queue.

@anakrish anakrish merged commit 5fa55d7 into microsoft:main Jan 21, 2025
17 checks passed
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.

2 participants