Skip to content

Commit

Permalink
chore: apply new clippy 1.73 suggestions
Browse files Browse the repository at this point in the history
bitflags 1.3 won't be updated to avoid triggering the bad-bit-macro
check, it really is time to update to bitflags 2.
  • Loading branch information
Mira Ressel committed Oct 10, 2023
1 parent fb97a9e commit ebd894c
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ rustflags = [
"-Aclippy::derivable_impls", # false positives
"-Aclippy::stable_sort_primitive", # prefer stable sort
"-Aclippy::extra-unused-type-parameters", # stylistic
"-Aclippy::default_constructed_unit_structs", # stylistic
"-Aclippy::bad-bit-mask", # triggered by macro behaviour in bitflags 1.3.2
]
4 changes: 2 additions & 2 deletions polkadot/node/core/backing/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1595,8 +1595,8 @@ fn retry_works() {
},
AllMessages::RuntimeApi(RuntimeApiMessage::Request(
_,
RuntimeApiRequest::SessionExecutorParams(sess_idx, tx),
)) if sess_idx == 1 => {
RuntimeApiRequest::SessionExecutorParams(1, tx),
)) => {
tx.send(Ok(Some(ExecutorParams::default()))).unwrap();
},
msg => {
Expand Down
1 change: 0 additions & 1 deletion polkadot/node/overseer/examples/minimal-example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ fn main() {
.unwrap();

let overseer_fut = overseer.run().fuse();
let timer_stream = timer_stream;

pin_mut!(timer_stream);
pin_mut!(overseer_fut);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,6 @@ impl NetworkBehaviour for Notifications {
let delay_id = self.next_delay_id;
self.next_delay_id.0 += 1;
let delay = futures_timer::Delay::new(ban_duration);
let peer_id = peer_id;
self.delays.push(
async move {
delay.await;
Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/preimage/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ pub mod v1 {
None =>
OldRequestStatus::Requested { deposit: None, count: 1, len: Some(len) },
},
v0::OldRequestStatus::Requested(count) if count == 0 => {
v0::OldRequestStatus::Requested(0) => {
log::error!(target: TARGET, "preimage has counter of zero: {:?}", hash);
continue
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ fn worst_case_pov(

/// A simple match statement which outputs the log 16 of some value.
fn easy_log_16(i: u32) -> u32 {
#[allow(clippy::redundant_guards)]
match i {
i if i == 0 => 0,
i if i <= 16 => 1,
Expand Down

0 comments on commit ebd894c

Please sign in to comment.