Skip to content

Commit

Permalink
remove ParseIntError / HexFormatError prefix.
Browse files Browse the repository at this point in the history
  • Loading branch information
mswift42 committed Jan 5, 2020
1 parent b7c86bf commit a787bb8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions palette/src/rgb/rgb.rs
Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -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::<Srgb,u8>::from_str("#08f");
assert_eq!(c.unwrap(), Rgb::<Srgb,u8>::new(0, 136, 255));
Expand All @@ -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::<Srgb,u8>::from_str("da0bce");
Expand Down

0 comments on commit a787bb8

Please sign in to comment.