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 { .flat_map(|style| match style {
StyleElement::Text(text) => text.as_ref().chars(), StyleElement::Text(text) => text.as_ref().chars(),
StyleElement::Variable(name) => { StyleElement::Variable(name) => {
let variable = variables let variable = variables.get(name.as_ref()).unwrap_or(&None);
.get(name.as_ref())
.expect(&format!("Style variable {} not found in cache", &name));
match variable { match variable {
Some(style_string) => style_string.chars(), Some(style_string) => style_string.chars(),
None => "".chars(), None => "".chars(),