Mercurial > touhou
diff src/th06/std.rs @ 755:fc937d93a57c
Bump nom to version 6, and image to 0.23.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Mon, 04 Jan 2021 21:14:02 +0100 |
parents | 13fd434d5d1b |
children |
line wrap: on
line diff
--- a/src/th06/std.rs +++ b/src/th06/std.rs @@ -166,7 +166,7 @@ declare_stage_instructions!{ fn parse_quad(i: &[u8]) -> IResult<&[u8], Quad> { let (i, (unk1, size)) = tuple((le_u16, le_u16))(i)?; if unk1 == 0xffff { - return Err(Err::Error((i, ErrorKind::Eof))); + return Err(Err::Error(nom::error::Error::new(i, ErrorKind::Eof))); } // TODO: replace this assert with a custom error. assert_eq!(size, 0x1c); @@ -193,7 +193,7 @@ fn parse_model(i: &[u8]) -> IResult<&[u8 fn parse_instance(i: &[u8]) -> IResult<&[u8], Instance> { let (i, (id, unknown, x, y, z)) = tuple((le_u16, le_u16, le_f32, le_f32, le_f32))(i)?; if id == 0xffff && unknown == 0xffff { - return Err(Err::Error((i, ErrorKind::Eof))); + return Err(Err::Error(nom::error::Error::new(i, ErrorKind::Eof))); } // TODO: replace this assert with a custom error. assert_eq!(unknown, 0x100); @@ -207,7 +207,7 @@ fn parse_instance(i: &[u8]) -> IResult<& fn parse_instruction(i: &[u8]) -> IResult<&[u8], Call> { let (i, (time, opcode, size)) = tuple((le_u32, le_u16, le_u16))(i)?; if time == 0xffffffff && opcode == 0xffff && size == 0xffff { - return Err(Err::Error((i, ErrorKind::Eof))); + return Err(Err::Error(nom::error::Error::new(i, ErrorKind::Eof))); } // TODO: replace this assert with a custom error. assert_eq!(size, 12);