Skip to content

Commit bcc6c47

Browse files
author
mflinn-broad
committed
more cleanup
1 parent 150fc37 commit bcc6c47

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/days/day10.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,15 @@ fn part_2(input: &Vec<Vec<char>>) -> usize {
6060
'[' => stack.push(']'),
6161
'{' => stack.push('}'),
6262
'<' => stack.push('>'),
63-
x if *x == stack[stack.len() - 1] => {
63+
x if x == stack.last().unwrap() => {
6464
stack.pop();
6565
}
6666
_ => {
6767
return Vec::new();
6868
}
6969
}
7070
}
71-
if stack.is_empty(){
72-
Vec::new()
73-
} else {
74-
stack
75-
}
71+
stack
7672
})
7773
.filter(|completion| !completion.is_empty())
7874
.map(|completion| {

0 commit comments

Comments
 (0)