Skip to content

Fix clippy warning for result?#362

Merged
anakrish merged 1 commit intomicrosoft:mainfrom
thedavemarshall:dm-update-cbindgen
Jan 21, 2025
Merged

Fix clippy warning for result?#362
anakrish merged 1 commit intomicrosoft:mainfrom
thedavemarshall:dm-update-cbindgen

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