clean it up a bit
This commit is contained in:
parent
05a3283daa
commit
f8ab92bf26
14
src/main.rs
14
src/main.rs
|
@ -26,14 +26,12 @@ fn main() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
let loc = if line[l - 6] == b';' {
|
let loc = match line[l - 6..][..3] {
|
||||||
l - 6
|
[b';', _, _] => l - 6,
|
||||||
} else if line[l - 5] == b';' {
|
[_, b';', _] => l - 5,
|
||||||
l - 5
|
[_, _, b';'] => l - 4,
|
||||||
} else if line[l - 4] == b';' {
|
|
||||||
l - 4
|
_ => unreachable!(),
|
||||||
} else {
|
|
||||||
unreachable!();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let (city, val) = line.split_at(loc);
|
let (city, val) = line.split_at(loc);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user