From bd2cab1c2e7f8d896b4a47a67b8458b6e74f0431 Mon Sep 17 00:00:00 2001 From: Felix Zeller Date: Mon, 4 Mar 2024 06:27:17 -0500 Subject: [PATCH] fix: show not backlinks if len = 0 --- src/ui.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui.rs b/src/ui.rs index a34e3b05..b8f8cd21 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -21,7 +21,7 @@ fn referenceable_string(vault: &Vault, referenceable: &Referenceable) -> Option< }; let backlinks_preview = match vault.select_references_for_referenceable(referenceable) { - Some(references) => references + Some(references) if references.len() > 0 => references .into_iter() .flat_map(|(path, reference)| { let line = String::from_iter( @@ -33,7 +33,7 @@ fn referenceable_string(vault: &Vault, referenceable: &Referenceable) -> Option< Some(format!("- `{}`: `{}`", path, line)) // and select indented list }) .join("\n"), - None => format!("No Backlinks"), + _ => format!("No Backlinks"), }; return Some(format!(