diff --git a/rust/src/p0035.rs b/rust/src/p0035.rs index 79838f3e..8dda94ad 100644 --- a/rust/src/p0035.rs +++ b/rust/src/p0035.rs @@ -43,7 +43,7 @@ impl Iterator for Rotations { fn next(&mut self) -> Option { if self.i < self.x.len() { - let result = (self.x[self.i..] + self.x[..self.i]).parse::().unwrap(); + let result = (format!("{self.x[self.i..]}{self.x[..self.i]}")).parse::().unwrap(); self.i += 1; return Some(result); } diff --git a/rust/src/p0041.rs b/rust/src/p0041.rs index 3048e330..0fbe99f9 100644 --- a/rust/src/p0041.rs +++ b/rust/src/p0041.rs @@ -22,7 +22,7 @@ pub fn p0041() -> Answer { if num_digits > 7 { break; } - if cur_digits.bytes().any(|b| ((b - b'0').into() > num_digits || cur_digits.bytes().filter(|c| c == b).count() != 1)) { + if cur_digits.bytes().any(|b| ((b - b'0').into() > num_digits || cur_digits.bytes().filter(|c| *c == b).count() != 1)) { continue; } if p > answer {