mirror of
https://github.com/Noratrieb/advent-of-code.git
synced 2026-01-17 02:55:01 +01:00
fmt
This commit is contained in:
parent
547882d18f
commit
01e3733421
6 changed files with 10 additions and 8 deletions
|
|
@ -6,7 +6,7 @@ fn line_match_count(line: &str) -> usize {
|
|||
.split_ascii_whitespace()
|
||||
.collect::<arrayvec::ArrayVec<_, 16>>();
|
||||
|
||||
let you_have = numbers.next().unwrap().split_ascii_whitespace();
|
||||
let you_have = numbers.next().unwrap().split_ascii_whitespace();
|
||||
|
||||
you_have
|
||||
.filter(|have| winning.iter().any(|w| w == have))
|
||||
|
|
|
|||
|
|
@ -4,7 +4,11 @@ fn line_match_count(line: &str) -> usize {
|
|||
((chunk[1] as u16) << 8) | (chunk[2] as u16)
|
||||
}
|
||||
|
||||
let mut numbers = line.split(|&b| b == b':').nth(1).unwrap().split(|&b| b == b'|');
|
||||
let mut numbers = line
|
||||
.split(|&b| b == b':')
|
||||
.nth(1)
|
||||
.unwrap()
|
||||
.split(|&b| b == b'|');
|
||||
let winning = numbers
|
||||
.next()
|
||||
.unwrap()
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ fn line_match_count(line: &str) -> usize {
|
|||
.split_whitespace()
|
||||
.collect::<arrayvec::ArrayVec<_, 16>>();
|
||||
|
||||
let you_have = numbers.next().unwrap().split_whitespace();
|
||||
let you_have = numbers.next().unwrap().split_whitespace();
|
||||
|
||||
you_have
|
||||
.filter(|have| winning.iter().any(|w| w == have))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue