10
src/theme.rs
10
src/theme.rs
@@ -10,8 +10,14 @@ macro_rules! load_color {
|
||||
$theme
|
||||
.as_ref()
|
||||
.and_then(|t| t.$member.clone())
|
||||
.map(|c| Color::parse(c.as_ref()).expect(&format!("Failed to parse color \"{}\"", c)))
|
||||
.unwrap_or($default)
|
||||
.and_then(|c| Color::parse(c.as_ref()))
|
||||
.unwrap_or_else(|| {
|
||||
warn!(
|
||||
"Failed to parse color in \"{}\", falling back to default",
|
||||
stringify!($member)
|
||||
);
|
||||
$default
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user