mirror of
https://github.com/Ajetski/advent-of-code.git
synced 2025-09-30 05:23:17 -09:00
fix error type for parsing
This commit is contained in:
parent
28119de098
commit
bd3d47f442
@ -173,12 +173,12 @@ impl std::hash::Hash for Tile {
|
||||
}
|
||||
}
|
||||
impl std::str::FromStr for Tile {
|
||||
type Err = std::string::ParseError;
|
||||
type Err = std::num::ParseIntError;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
let (id_line, grid_lines) = s.split_once('\n').unwrap();
|
||||
Ok(Tile {
|
||||
id: id_line[5..id_line.chars().count() - 1].parse().unwrap(),
|
||||
id: id_line[5..id_line.chars().count() - 1].parse()?,
|
||||
grid: grid_lines
|
||||
.trim()
|
||||
.split('\n')
|
||||
|
Loading…
x
Reference in New Issue
Block a user