From 2d3f55097ca529a69a1f5b078b3a9e0c698b171c Mon Sep 17 00:00:00 2001 From: Bert Peters Date: Fri, 23 Dec 2022 19:12:20 +0100 Subject: [PATCH] Simple type to help clippy --- 2022/src/day22.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/2022/src/day22.rs b/2022/src/day22.rs index 7f88bfb..9be8d06 100644 --- a/2022/src/day22.rs +++ b/2022/src/day22.rs @@ -28,6 +28,8 @@ enum Direction { Right = 0, } +type Map<'a> = Vec<&'a [u8]>; + impl Direction { fn turn_left(self) -> Self { match self { @@ -48,7 +50,7 @@ impl Direction { } } -fn parse_map(input: &[u8]) -> IResult<&[u8], (Vec<&[u8]>, Vec)> { +fn parse_map(input: &[u8]) -> IResult<&[u8], (Map, Vec)> { separated_pair( map(take_until("\n\n"), |map: &[u8]| { map.split(|&b| b == b'\n').collect()