fix: Fix clippy

This commit is contained in:
heyrict 2020-04-22 17:49:15 +08:00
parent 2fb052d68c
commit 3b459f4379
No known key found for this signature in database
GPG Key ID: 803E2EACED3FF3AA

View File

@ -94,9 +94,7 @@ impl<'a> StringFormatter<'a> {
.flat_map(|style| match style {
StyleElement::Text(text) => text.as_ref().chars(),
StyleElement::Variable(name) => {
let variable = variables
.get(name.as_ref())
.expect(&format!("Style variable {} not found in cache", &name));
let variable = variables.get(name.as_ref()).unwrap_or(&None);
match variable {
Some(style_string) => style_string.chars(),
None => "".chars(),