diff --git a/2021/day16/day16_rs/src/main.rs b/2021/day16/day16_rs/src/main.rs index 0f4e01d..104b08d 100644 --- a/2021/day16/day16_rs/src/main.rs +++ b/2021/day16/day16_rs/src/main.rs @@ -7,7 +7,7 @@ use std::{ use nom::{ bits::complete as bits, - multi::{many0, many_m_n}, + multi::{many0, many_m_n}, Offset, }; use nom::{combinator::map, sequence::pair}; use parsers::fold_till; @@ -99,7 +99,8 @@ impl PacketType { let (subpackets_end, subpackets) = many0(Packet::parse)(subpackets_input)?; let new_input = (&i.0[new_byte_offset..], new_bit_offset); - assert_eq!(subpackets_end, new_input); + assert_eq!(i.0.offset(subpackets_end.0), i.0.offset(new_input.0)); + assert_eq!(subpackets_end.1, new_input.1); Ok(( new_input,