Skip to content

Commit

Permalink
leetcode: Fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
XuShaohua committed Dec 8, 2023
1 parent 750aeb5 commit c26db33
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub fn search_range(nums: Vec<i32>, target: i32) -> [i32; 2] {
return NOT_FOUND;
}

// TODO(Shaohua): Replace with another round of binary search
while nums[low] == target {
low -= 1;
}
Expand Down
4 changes: 2 additions & 2 deletions leetcode/0137.single-number-ii/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ pub type Digits = [i32; DIGIT_LEN];

fn to_digits(mut num: i32) -> Digits {
let mut digits = [0; DIGIT_LEN];
for i in 0..DIGIT_LEN {
digits[i] = num % 2;
for digit in digits.iter_mut() {
*digit = num % 2;
num /= 2;
}
digits
Expand Down

0 comments on commit c26db33

Please sign in to comment.