apply clippy optimizations

This commit is contained in:
yggverse 2024-12-05 16:46:44 +02:00
parent 8ec4b467ce
commit 5ae2c2327a
2 changed files with 3 additions and 9 deletions

View File

@ -67,7 +67,7 @@ impl Gemini {
}; };
// Init tooltip components // Init tooltip components
let mut tooltip = format!("<b>Certificate</b>\n"); let mut tooltip = "<b>Certificate</b>\n".to_string();
if let Some(subject_name) = certificate.subject_name() { if let Some(subject_name) = certificate.subject_name() {
tooltip tooltip
@ -110,7 +110,7 @@ impl Gemini {
scope.push(format!("<small>{}</small>", auth.scope.clone())) scope.push(format!("<small>{}</small>", auth.scope.clone()))
} }
if scope.len() > 0 { if !scope.is_empty() {
tooltip.push_str(&format!("\n\n<b>Scope</b>\n\n{}", scope.join("\n"))); tooltip.push_str(&format!("\n\n<b>Scope</b>\n\n{}", scope.join("\n")));
} }

View File

@ -37,13 +37,7 @@ impl Item {
) )
.property("title", title) .property("title", title)
.property("subtitle", subtitle) .property("subtitle", subtitle)
.property( .property("tooltip", tooltip.unwrap_or_default())
"tooltip",
match tooltip {
Some(text) => text,
None => "", // NULL
},
)
.property("is_active", is_active) .property("is_active", is_active)
.build() .build()
} }