[go: nahoru, domu]

Skip to content

Commit

Permalink
Clippy auto fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-harding committed Sep 6, 2023
1 parent 9be3fef commit 422c035
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/solutions/_01_arrays_and_strings/_03_urlify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ impl Urlify for Solution {
let mut dst = bytes.len();
for i in (0..len).rev() {
dst -= 1;
if bytes[i] == ' ' as u8 {
bytes[dst - 2] = '%' as u8;
bytes[dst - 1] = '2' as u8;
bytes[dst - 0] = '0' as u8;
if bytes[i] == b' ' {
bytes[dst - 2] = b'%';
bytes[dst - 1] = b'2';
bytes[dst] = b'0';
dst -= 2;
} else {
bytes[dst] = bytes[i];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fn append_count(s: &mut String, mut count: usize) {
let v = unsafe { s.as_mut_vec() };
let mut count_chars = 0;
while count > 0 {
v.push((count % 10) as u8 + '0' as u8);
v.push((count % 10) as u8 + b'0');
count /= 10;
count_chars += 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ impl RobotOnAGrid for Solution {
}
}

if access[floor.height() * floor.width() - 1].is_none() {
return None;
}
access[floor.height() * floor.width() - 1]?;

let mut path = vec![Step::Right; floor.width() + floor.height() - 2];

Expand Down

0 comments on commit 422c035

Please sign in to comment.