Compare commits
1 commit
51b5893d56
...
d63b39487d
Author | SHA1 | Date | |
---|---|---|---|
Tristan Daniël Maat | d63b39487d |
|
@ -17,7 +17,9 @@ fn parse_passports(input: &str) -> Result<Vec<HashMap<&str, &str>>, &str> {
|
||||||
.trim()
|
.trim()
|
||||||
.split(|c| c == ' ' || c == '\n')
|
.split(|c| c == ' ' || c == '\n')
|
||||||
.map(|field| {
|
.map(|field| {
|
||||||
let item = field.split_at(3);
|
let split = field.find(':').ok_or("Invalid passport value")?;
|
||||||
|
let item = field.split_at(split);
|
||||||
|
|
||||||
let key = item.0;
|
let key = item.0;
|
||||||
let value = item
|
let value = item
|
||||||
.1
|
.1
|
||||||
|
|
Loading…
Reference in a new issue