clean it up a bit

This commit is contained in:
Ishan Jain 2024-01-14 03:48:25 +05:30
parent 05a3283daa
commit f8ab92bf26
Signed by: ishan
GPG Key ID: 0506DB2A1CC75C27

View File

@ -26,14 +26,12 @@ fn main() {
return None;
}
let loc = if line[l - 6] == b';' {
l - 6
} else if line[l - 5] == b';' {
l - 5
} else if line[l - 4] == b';' {
l - 4
} else {
unreachable!();
let loc = match line[l - 6..][..3] {
[b';', _, _] => l - 6,
[_, b';', _] => l - 5,
[_, _, b';'] => l - 4,
_ => unreachable!(),
};
let (city, val) = line.split_at(loc);