Skip to content

Commit

Permalink
clippy: accounts-db lints (solana-labs#34628)
Browse files Browse the repository at this point in the history
```
warning: this `let...else` may be rewritten with the `?` operator
  --> accounts-db/src/rolling_bit_field/iterators.rs:36:13
   |
36 | /             let Some(bit) = self.bit_range.next() else {
37 | |                 return None;
38 | |             };
   | |______________^ help: replace it with: `let bit = self.bit_range.next()?;`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
   = note: `#[warn(clippy::question_mark)]` on by default

    Checking solana-rpc-client-api v1.18.0 (/Users/brooks/src/solana/rpc-client-api)
warning: `solana-accounts-db` (lib) generated 1 warning
```
  • Loading branch information
brooksprumo authored Jan 3, 2024
1 parent de976be commit e4ec68d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions accounts-db/src/rolling_bit_field/iterators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ impl Iterator for RollingBitFieldOnesIter<'_> {
// Then iterate over the bit vec
loop {
// If there are no more bits in the range, then we've iterated over everything and are done
let Some(bit) = self.bit_range.next() else {
return None;
};
let bit = self.bit_range.next()?;

if self.rolling_bit_field.contains_assume_in_range(&bit) {
break Some(bit);
Expand Down

0 comments on commit e4ec68d

Please sign in to comment.