Skip to content

Commit 3ea5068

Browse files
committed
Minor
1 parent 71e82a6 commit 3ea5068

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

aoc_utils/src/lib.rs

+8
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,14 @@ where
289289
if y < 0 { x - (-y) as u64 } else { x + y as u64 }
290290
}
291291

292+
pub fn ufroms(s: &str) -> u64 {
293+
s.parse().expect("Should parse number")
294+
}
295+
296+
pub fn ufromc(c: char) -> u32 {
297+
c.to_digit(10).expect("Should parse number")
298+
}
299+
292300
pub trait InputParse<'a> {
293301
fn mlines<F, U>(self, f: F) -> Vec<U>
294302
where

0 commit comments

Comments
 (0)