Skip to content

Commit

Permalink
Turns out from() exists
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Jul 23, 2024
1 parent 4d143cc commit dd1139e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rust/src/p0034.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn p0034() -> i128 {
for x in 10..100000 {
let sum = x.to_string()
.bytes()
.fold(0, |a, b| a + factorial::<u32>(b - '0'.into::<u8>()));
.fold(0, |a, b| a + factorial::<u32>(b - u8::from('0')));
if sum == x {
answer += x;
}
Expand Down

0 comments on commit dd1139e

Please sign in to comment.