diff --git a/src/lib.rs b/src/lib.rs index 58dba71..0bf245d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -297,7 +297,7 @@ impl fmt::Display for ParseError { f, "Invalid byte count; Matched `{}` bytes ({:?})", found, - &eui[..found] + eui ), } } @@ -745,6 +745,10 @@ mod tests { "Err(InvalidByteCount(7, [18, 52, 86, 171, 205, 239]))".to_owned(), format!("{:?}", MacAddress::parse_str("123456ABCDEF1")) ); + assert_eq!( + "Invalid byte count; Matched `7` bytes ([18, 52, 86, 171, 205, 239])".to_owned(), + format!("{}", MacAddress::parse_str("123456ABCDEF1").unwrap_err()) + ); assert_eq!( "Err(InvalidLength(19))", format!("{:?}", MacAddress::parse_str("12##45#67#89#AB#C#D"))