Skip to content

Commit

Permalink
removes RGBA variant from impl FromHexError::from(str)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelbeckel committed Aug 25, 2023
1 parent b98caf6 commit 1cd6ba1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions palette/src/rgb/rgb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -948,12 +948,10 @@ impl From<ParseIntError> for FromHexError {

impl From<&'static str> for FromHexError {
fn from(err: &'static str) -> FromHexError {
match err {
err if err.contains("rgba") => FromHexError::RgbaHexFormatError(err),
_ => FromHexError::HexFormatError(err),
}
FromHexError::HexFormatError(err)
}
}

impl core::fmt::Display for FromHexError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match &*self {
Expand Down

0 comments on commit 1cd6ba1

Please sign in to comment.