diff --git a/palette/src/rgb/rgb.rs b/palette/src/rgb/rgb.rs index f513ed74b..ba2273b3f 100644 --- a/palette/src/rgb/rgb.rs +++ b/palette/src/rgb/rgb.rs @@ -976,10 +976,10 @@ impl core::fmt::Display for FromHexError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match &*self { FromHexError::ParseIntError(e) => { - write!(f, "ParseIntError: {}", e) + write!(f, "{}", e) } FromHexError::HexFormatError(s) => { - write!(f, "HexFormatError: {}, please use format '#fff', 'fff', '#ffffff' or\ + write!(f, "{}, please use format '#fff', 'fff', '#ffffff' or\ 'ffffff'.", s) } } @@ -1184,7 +1184,7 @@ mod test { assert!(c.is_err()); assert_eq!( format!("{}", c.err().unwrap()), - "ParseIntError: invalid digit found in string" + "invalid digit found in string" ); let c = Rgb::::from_str("#08f"); assert_eq!(c.unwrap(), Rgb::::new(0, 136, 255)); @@ -1196,7 +1196,7 @@ mod test { assert!(c.is_err()); assert_eq!( format!("{}", c.err().unwrap()), - "HexFormatError: invalid hex code format, \ + "invalid hex code format, \ please use format \'#fff\', \'fff\', \'#ffffff\' or\'ffffff\'." ); let c = Rgb::::from_str("da0bce");