From 7420c91553c622849fd2de4aaa1d4c1a6e7def3b Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Sun, 5 Jan 2020 11:35:05 -0800 Subject: [PATCH] Rename bencode::Error::ExtraData -> TrailingData type: reform --- src/bencode.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bencode.rs b/src/bencode.rs index 84ed810..d8c1569 100644 --- a/src/bencode.rs +++ b/src/bencode.rs @@ -101,7 +101,7 @@ impl<'buffer> Display for Value<'buffer> { #[derive(Debug, PartialEq)] pub(crate) enum Error { - ExtraData { start: usize }, + TrailingData { start: usize }, UnexpectedEndOfBuffer, UnexpectedByte { found: u8 }, UnsortedKey, @@ -127,7 +127,7 @@ impl<'buffer> Parser<'buffer> { let root = self.value()?; if self.index != self.buffer.len() { - return Err(ExtraData { start: self.index }); + return Err(TrailingData { start: self.index }); } Ok(root) @@ -334,10 +334,10 @@ mod tests { #[test] fn misc() { err("", UnexpectedEndOfBuffer); - err("i20efoo", ExtraData { start: 4 }); - err("defoo", ExtraData { start: 2 }); - err("lefoo", ExtraData { start: 2 }); - err("1:afoo", ExtraData { start: 3 }); + err("i20efoo", TrailingData { start: 4 }); + err("defoo", TrailingData { start: 2 }); + err("lefoo", TrailingData { start: 2 }); + err("1:afoo", TrailingData { start: 3 }); } #[test]