(s_x, s_y, b_x, b_y)) = all_consuming(tuple(( preceded(tag("Sensor at x="), parse_i64), preceded(tag(", y="), parse_i64), preceded(tag(": closest beacon is at x="), parse_i64), preceded(tag(", y="), parse_i64), )))(input)?; let p1 = Pos { x: s_x, y: s_y }; let p2 = Pos { x: b_x, y: b_y }; Ok((input, (p1, p2))) } 1 2 3 4 5 6 7 8 9 10 11 fn parse_line(input: &str) -> IResult<&str, (Pos, Pos)> { } 1 let (input, (s_x, s_y, b_x, b_y)) = all_consuming(tuple(( 2 preceded(tag("Sensor at x="), parse_i64), 3 preceded(tag(", y="), parse_i64), 4 preceded(tag(": closest beacon is at x="), parse_i64), 5 preceded(tag(", y="), parse_i64), 6 )))(input)?; 7 let p1 = Pos { x: s_x, y: s_y }; 8 let p2 = Pos { x: b_x, y: b_y }; 9 Ok((input, (p1, p2))) 10 11 let (input, (s_x, s_y, b_x, b_y)) = all_consuming(tuple(( preceded(tag("Sensor at x="), parse_i64), preceded(tag(", y="), parse_i64), preceded(tag(": closest beacon is at x="), parse_i64), preceded(tag(", y="), parse_i64), )))(input)?; fn parse_line(input: &str) -> IResult<&str, (Pos, Pos)> { 1 2 3 4 5 6 7 let p1 = Pos { x: s_x, y: s_y }; 8 let p2 = Pos { x: b_x, y: b_y }; 9 Ok((input, (p1, p2))) 10 } 11 let p1 = Pos { x: s_x, y: s_y }; let p2 = Pos { x: b_x, y: b_y }; fn parse_line(input: &str) -> IResult<&str, (Pos, Pos)> { 1 let (input, (s_x, s_y, b_x, b_y)) = all_consuming(tuple(( 2 preceded(tag("Sensor at x="), parse_i64), 3 preceded(tag(", y="), parse_i64), 4 preceded(tag(": closest beacon is at x="), parse_i64), 5 preceded(tag(", y="), parse_i64), 6 )))(input)?; 7 8 9 Ok((input, (p1, p2))) 10 } 11 Ok((input, (p1, p2))) fn parse_line(input: &str) -> IResult<&str, (Pos, Pos)> { 1 let (input, (s_x, s_y, b_x, b_y)) = all_consuming(tuple(( 2 preceded(tag("Sensor at x="), parse_i64), 3 preceded(tag(", y="), parse_i64), 4 preceded(tag(": closest beacon is at x="), parse_i64), 5 preceded(tag(", y="), parse_i64), 6 )))(input)?; 7 let p1 = Pos { x: s_x, y: s_y }; 8 let p2 = Pos { x: b_x, y: b_y }; 9 10 } 11 fn parse_line(input: &str) -> IResult<&str, (Pos, Pos)> { let (input, (s_x, s_y, b_x, b_y)) = all_consuming(tuple(( preceded(tag("Sensor at x="), parse_i64), preceded(tag(", y="), parse_i64), preceded(tag(": closest beacon is at x="), parse_i64), preceded(tag(", y="), parse_i64), )))(input)?; let p1 = Pos { x: s_x, y: s_y }; let p2 = Pos { x: b_x, y: b_y }; Ok((input, (p1, p2))) } 1 2 3 4 5 6 7 8 9 10 11 loige 100