enshort constructions

This commit is contained in:
yggverse 2024-11-08 05:26:05 +02:00
parent c843e5b7c0
commit 4342796d1a
2 changed files with 4 additions and 9 deletions

View file

@ -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}"),