From 4342796d1a28730cbdb098f1c8608bdd934a9a7d Mon Sep 17 00:00:00 2001 From: yggverse Date: Fri, 8 Nov 2024 05:26:05 +0200 Subject: [PATCH] enshort constructions --- src/app/browser/window/tab.rs | 7 +++---- src/app/browser/window/tab/item/page.rs | 6 +----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/app/browser/window/tab.rs b/src/app/browser/window/tab.rs index 2bbebf69..2614f093 100644 --- a/src/app/browser/window/tab.rs +++ b/src/app/browser/window/tab.rs @@ -91,10 +91,9 @@ impl Tab { action_page_reload.clone(), action_update.clone(), // Options - match gobject.selected_page() { - Some(page) => Some(gobject.page_position(&page) + 1), - None => None, - }, + gobject + .selected_page() + .map(|page| gobject.page_position(&page) + 1), false, false, ); diff --git a/src/app/browser/window/tab/item/page.rs b/src/app/browser/window/tab/item/page.rs index 77dfd0a1..1d87ee3e 100644 --- a/src/app/browser/window/tab/item/page.rs +++ b/src/app/browser/window/tab/item/page.rs @@ -975,11 +975,7 @@ pub fn migrate(tx: &Transaction) -> Result<(), String> { /// /// * this feature may be improved and moved outside @TODO fn uri_to_title(uri: &Uri) -> GString { - let title = GString::from(match uri.path().split('/').last() { - Some(filename) => filename, - None => "", - }); - + let title = GString::from(uri.path().split('/').last().unwrap_or_default()); if title.is_empty() { match uri.host() { Some(host) => gformat!("{host}"),