This commit is contained in:
unintendedfraud
2023-12-08 14:53:51 +01:00
parent c3184967a0
commit b091f091d5
+8
View File
@@ -32,3 +32,11 @@ pub fn get_data(path: &str) -> Vec<String> {
return lines; return lines;
} }
pub fn get_numbers_from_str(s: &str, delimiter: &str) -> Vec<usize> {
return s
.split(delimiter)
.filter(|x| !x.is_empty())
.map(|x| x.trim().parse().expect("failed to parse string"))
.collect();
}