From 5ae2c2327ae669c2258ed203124663af375f66a9 Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 5 Dec 2024 16:46:44 +0200 Subject: [PATCH] apply clippy optimizations --- src/app/browser/window/tab/item/identity/gemini.rs | 4 ++-- .../tab/item/identity/gemini/widget/form/list/item.rs | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/app/browser/window/tab/item/identity/gemini.rs b/src/app/browser/window/tab/item/identity/gemini.rs index f7ebdd35..15489826 100644 --- a/src/app/browser/window/tab/item/identity/gemini.rs +++ b/src/app/browser/window/tab/item/identity/gemini.rs @@ -67,7 +67,7 @@ impl Gemini { }; // Init tooltip components - let mut tooltip = format!("Certificate\n"); + let mut tooltip = "Certificate\n".to_string(); if let Some(subject_name) = certificate.subject_name() { tooltip @@ -110,7 +110,7 @@ impl Gemini { scope.push(format!("{}", auth.scope.clone())) } - if scope.len() > 0 { + if !scope.is_empty() { tooltip.push_str(&format!("\n\nScope\n\n{}", scope.join("\n"))); } diff --git a/src/app/browser/window/tab/item/identity/gemini/widget/form/list/item.rs b/src/app/browser/window/tab/item/identity/gemini/widget/form/list/item.rs index eafd397d..eff046e0 100644 --- a/src/app/browser/window/tab/item/identity/gemini/widget/form/list/item.rs +++ b/src/app/browser/window/tab/item/identity/gemini/widget/form/list/item.rs @@ -37,13 +37,7 @@ impl Item { ) .property("title", title) .property("subtitle", subtitle) - .property( - "tooltip", - match tooltip { - Some(text) => text, - None => "", // NULL - }, - ) + .property("tooltip", tooltip.unwrap_or_default()) .property("is_active", is_active) .build() }