From c001d6ec59221b11af8e7aafce76002cc63604e6 Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 12 Feb 2022 17:31:32 +0100 Subject: Hide deck extension when showing title --- src/deck.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/deck.rs') diff --git a/src/deck.rs b/src/deck.rs index af322c6..3524c96 100644 --- a/src/deck.rs +++ b/src/deck.rs @@ -69,7 +69,7 @@ pub fn read(deck: &String) -> Result> { } pub fn pp_from_path(path: &String) -> Option { - Some(capitalize(Path::new(&path).file_name()?.to_str()?)) + Some(capitalize(Path::new(&path).with_extension("").file_name()?.to_str()?)) } fn capitalize(s: &str) -> String { -- cgit v1.2.3