reuse existing function
This commit is contained in:
parent
f1a0c5ce61
commit
eb8fd556e4
|
@ -9,9 +9,7 @@ pub struct Colour {
|
|||
|
||||
impl From<&str> for Colour {
|
||||
fn from(str: &str) -> Self {
|
||||
let rgb = hex::decode(&str[str.len() - 6..]).unwrap();
|
||||
|
||||
Colour { red: rgb[0], green: rgb[1], blue: rgb[2] }
|
||||
Self::from(hex::decode(&str[str.len() - 6..]).unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue