Skip to content

Commit

Permalink
Fix Clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
EFanZh committed Jun 22, 2024
1 parent 3ebf52e commit ef563c5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/problem_0553_optimal_division/dynamic_programming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ impl Solution {
let (top, row) = cache[..n * (length - 1) + (n + 1 - length)].split_at_mut(n * (length - 1));

for (start, slot) in row.iter_mut().enumerate() {
let mut min = std::f64::INFINITY;
let mut min = f64::INFINITY;
let mut min_left_length = 0;
let mut max = std::f64::NEG_INFINITY;
let mut max = f64::NEG_INFINITY;
let mut max_left_length = 0;

for left_length in 1..length {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ impl Solution {
if value % prime == 0 {
f(prime.get());

value = value / prime;
value /= prime;

while value % prime == 0 {
value = value / prime;
value /= prime;
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl Solution {
let mut base = 1;

loop {
target = target / x;
target /= x;

if target == 0 {
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl Solution {

for (group_size, &count) in (1..).zip(&group_states[..usize::from(batch_size.get()) - 1]) {
total_count += group_size * (x % count);
x = x / count;
x /= count;
}

(total_count % batch_size) as u8
Expand All @@ -86,7 +86,7 @@ impl Solution {
max_count.max(cache[usize::from(state - base.get())] + u8::from(last_group == total_count));
}

state_iter = state_iter / count;
state_iter /= count;
}

max_count
Expand Down
2 changes: 1 addition & 1 deletion src/problem_1837_sum_of_digits_in_base_k/iterative.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ impl Solution {

while n != 0 {
result += n % k;
n = n / k;
n /= k;
}

i32::from(result)
Expand Down

0 comments on commit ef563c5

Please sign in to comment.