refactor 01/02
This commit is contained in:
parent
ca7dd3dad3
commit
d126d69669
@ -9,15 +9,14 @@ fn main() {
|
||||
fn process(input: &str) -> i32 {
|
||||
let lines: i32 = input
|
||||
.lines()
|
||||
.into_iter()
|
||||
.map(|x| replacer(x))
|
||||
.map(replacer)
|
||||
.map(|line| {
|
||||
println!("{line}");
|
||||
let line_vec = line
|
||||
.chars()
|
||||
.filter(|c| c.is_digit(10))
|
||||
.filter(|c| c.is_ascii_digit())
|
||||
.collect::<Vec<char>>();
|
||||
let first = line_vec.clone().into_iter().nth(0);
|
||||
let first = line_vec.clone().into_iter().next();
|
||||
let last = line_vec.clone().into_iter().nth_back(0);
|
||||
[first.unwrap(), last.unwrap()].into_iter().collect()
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user