diff --git a/src/config.rs b/src/config.rs index d49caae8..4dffa70a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -965,8 +965,11 @@ impl FromStr for Rgb { } } - if chars.next().unwrap() != '0' { return Err(()); } - if chars.next().unwrap() != 'x' { return Err(()); } + match chars.next().unwrap() { + '0' => if chars.next().unwrap() != 'x' { return Err(()); }, + '#' => (), + _ => return Err(()), + } component!(r, g, b);