Skip to content

Conversation

@mkeeter
Copy link
Contributor

@mkeeter mkeeter commented Aug 18, 2025

This adds support for let chains

Changes were mostly done mechanically by cargo clippy --fix, with a few hand-edits to fix gen becoming reserved.

Comment on lines +903 to +908
&& let Some(rails) = &d.power.as_ref().unwrap().rails
{
if let Some(rails) = &d.power.as_ref().unwrap().rails {
if idx < rails.len() {
return Ok(rails[idx].clone());
} else {
bail!("sensor count exceeds rails for {:?}", d);
}
if idx < rails.len() {
return Ok(rails[idx].clone());
} else {
bail!("sensor count exceeds rails for {:?}", d);
Copy link
Contributor

Choose a reason for hiding this comment

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

This diff looks very strange without context, care to spot check it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After checking, I think this is correct – it hoisted the if let Some(..) into a let chain in the outer conditional.

@mkeeter mkeeter merged commit d27a127 into master Aug 19, 2025
11 checks passed
@mkeeter mkeeter deleted the mkeeter/rust-2024-1.88 branch August 19, 2025 15:11
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