Address cargo clippy output.

This commit is contained in:
2021-12-05 14:51:58 -08:00
parent 5b65e8ec71
commit 45f780c1ca
6 changed files with 21 additions and 33 deletions

View File

@@ -105,11 +105,11 @@ impl FromStr for Line {
type Err = LineError;
fn from_str(s: &str) -> Result<Self, Self::Err> {
let mut it = s.split(" ");
let mut it = s.split(' ');
let parse_point = |it: &mut dyn Iterator<Item = &str>| -> Result<Point, LineError> {
let p = it.next().ok_or(LineError::PrematureEOL)?;
let nums: Vec<_> = p
.split(",")
.split(',')
.map(|n| n.parse())
.collect::<Result<_, ParseIntError>>()?;
Ok(Point {
@@ -178,7 +178,7 @@ impl Debug for Image {
#[aoc_generator(day5)]
fn parse(input: &str) -> Result<Vec<Line>> {
Ok(input
.split("\n")
.split('\n')
.map(|l| l.parse())
.collect::<Result<_, LineError>>()?)
}