Skip to content

Commit

Permalink
nightly clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jstuczyn committed Dec 27, 2024
1 parent 359e723 commit e0f116a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 2021/day03/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct Day03;
fn most_common_bit(input: &[u16], position: u8) -> u8 {
let mut set_count = 0;
for num in input {
set_count += num >> position & 1;
set_count += (num >> position) & 1;
}

let unset = input.len() as u16 - set_count;
Expand Down Expand Up @@ -73,7 +73,7 @@ fn sieve(mut input: Vec<u16>, num_bits: u8, most_common: bool) -> u16 {
target_bit = !target_bit & 1;
}

input.retain(|x| (x >> bit & 1) as u8 == target_bit)
input.retain(|x| ((x >> bit) & 1) as u8 == target_bit)
}

if input.len() > 1 {
Expand Down

0 comments on commit e0f116a

Please sign in to comment.