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; 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);