From a4aefd35af572713188165ef6b637ef419c93757 Mon Sep 17 00:00:00 2001 From: Olivia Appleton Date: Thu, 18 Jul 2024 00:28:25 -0500 Subject: [PATCH] Change type of c --- rust/src/p0008.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/src/p0008.rs b/rust/src/p0008.rs index 5c02cdbe..5852cf1b 100644 --- a/rust/src/p0008.rs +++ b/rust/src/p0008.rs @@ -62,8 +62,8 @@ pub fn p0008() -> u64 { for i in 0..(string.len() - 13) { let slice = &string[i..(i + 13)]; let mut prod: u64 = 1; - for c in slice.bytes() { - prod *= (c - '0' as u8) as u64; + for c in slice.chars() { + prod *= (c - '0') as u64; } if prod > answer { answer = prod;