Skip to content

Conversation

@Mpinyaz
Copy link
Contributor

@Mpinyaz Mpinyaz commented Nov 26, 2025

  • changed the enum variant for ResponseCode::PrecoditionFailed to ResponseCode::PreconditionFailed
  • Updated conversions (TryFrom and From<&ResponseCode>) to map to and from this correct variant.
  • updated tests that implement this enum variant

Link to Issue below:
Fix Typo in ResponseCode::PrecoditionFailed #306

- changed the enum variant for `ResponseCode::PrecoditionFailed` to
`ResponseCode::PrecondtionFailed`
- Updated conversions (TryFrom<u16> and From<&ResponseCode>) to map to
and from this correct variant.
- updated tests that implement this enum variant
@Mpinyaz Mpinyaz changed the title fixed typo for ResponseCode::PrecoditionFailed Fixed typo for ResponseCode::PrecoditionFailed Nov 26, 2025
@Gsantomaggio
Copy link
Member

@Mpinyaz thank you for your PR.

Our company did some changes around open source contribution, and now it's required that you sign a contributor license agreement (CLA) before we can accept your PR.

The process is explained here in this repo README: https://github.com/rabbitmq/cla

Would you review and sign this CLA?

@Mpinyaz
Copy link
Contributor Author

Mpinyaz commented Nov 26, 2025

@Gsantomaggio okay no problem

yes done signed the CLA

@Gsantomaggio
Copy link
Member

@wolf4ood @allevo, any idea why the test fails? Thank you

@Mpinyaz
Copy link
Contributor Author

Mpinyaz commented Nov 26, 2025

@Gsantomaggio @wolf4ood @allevo
The build is using strict Clippy checks (note the -D warnings flag in the error output), which treats all warnings as errors. In this case, the binding_keys parameter is being unwrapped in an unidiomatic way - checking is_none() and then calling unwrap() instead of using Rust's pattern matching. Clippy's unnecessary_unwrap lint catches this and elevates it to an error level, causing the build to fail. I suggest this pattern matching would be better approach or mute the warning

if let Some(keys) = binding_keys {
    // handle Some case - `keys` is the extracted Vec<String>
    new_binding_keys = keys;
} else {
    // handle None case
}

@Gsantomaggio
Copy link
Member

@Mpinyaz, please go ahead with the fix.

#Refactor: Use if let for Option unwrapping in stream_creator

Changed binding_keys handling from:
- if binding_keys.is_none() + unwrap()
To:
- if let Some(keys) = binding_keys

This is more idiomatic Rust and resolves the clippy
unnecessary_unwrap lint error.

Additonally refactored the format! specifiers caught by the linter
warnings
@Mpinyaz
Copy link
Contributor Author

Mpinyaz commented Nov 27, 2025

@Gsantomaggio pushed changes to the PR and would like to also take note of the following:

  • I ran cargo clippy --all --all-features -- -D warnings locally to inspect if they are any other warnings that would stop the build from success and just found a few changes to the format specifiers for macros println! and format!
    Hopefully it will work and also checked previous PRs seems that was an issue all along

@codecov
Copy link

codecov bot commented Nov 27, 2025

Codecov Report

❌ Patch coverage is 55.55556% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.95%. Comparing base (6a98283) to head (5f376f9).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/stream_creator.rs 53.84% 6 Missing ⚠️
src/bin/perf-producer.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #307      +/-   ##
==========================================
- Coverage   89.12%   88.95%   -0.18%     
==========================================
  Files          81       81              
  Lines        7625     7125     -500     
==========================================
- Hits         6796     6338     -458     
+ Misses        829      787      -42     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Gsantomaggio Gsantomaggio self-assigned this Nov 27, 2025
@Gsantomaggio Gsantomaggio added this to the 0.10.0 milestone Nov 27, 2025
@Gsantomaggio Gsantomaggio merged commit ca9c52e into rabbitmq:main Nov 27, 2025
1 of 3 checks passed
@Gsantomaggio
Copy link
Member

Thank you @Mpinyaz

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