Skip to content

Commit

Permalink
Fix Clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
EFanZh committed Mar 19, 2024
1 parent f6a9dd1 commit d1a7681
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/problem_0111_minimum_depth_of_binary_tree/recursive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ impl Solution {
depth = 1;

loop {
match {
let children = {
let node_ref = node.borrow();

(node_ref.left.clone(), node_ref.right.clone())
} {
};

match children {
(None, None) => break,
(None, Some(child)) | (Some(child), None) => {
if let Some((next, next_depth)) = queue.pop_front() {
Expand Down
1 change: 1 addition & 0 deletions src/problem_0189_rotate_array/cyclic_replacements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ impl Solution {
x
}

#[allow(clippy::ptr_arg)] // Expected.
pub fn rotate(nums: &mut Vec<i32>, k: i32) {
let length = nums.len();
let k = (k as usize) % length;
Expand Down
1 change: 1 addition & 0 deletions src/problem_1089_duplicate_zeros/count_zeros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pub struct Solution;
// ------------------------------------------------------ snip ------------------------------------------------------ //

impl Solution {
#[allow(clippy::ptr_arg)] // Expected.
pub fn duplicate_zeros(arr: &mut Vec<i32>) {
let n = arr.len();
let mut required = 0;
Expand Down

0 comments on commit d1a7681

Please sign in to comment.