From 8a9b2e9a8f19d157d17bf8564f40618d7599a867 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 12 Mar 2018 13:30:30 +0100 Subject: [PATCH] Fix: use Path::file_stem() instead of Path::file_name() Because we don't want to know the extension of the filename here. --- lib/domain/libimagcontact/src/store.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/domain/libimagcontact/src/store.rs b/lib/domain/libimagcontact/src/store.rs index fdfc8384..aee5c62b 100644 --- a/lib/domain/libimagcontact/src/store.rs +++ b/lib/domain/libimagcontact/src/store.rs @@ -51,7 +51,7 @@ impl UniqueRefPathGenerator for UniqueContactPathGenerator { fn unique_hash>(path: A) -> RResult { debug!("Generating unique hash for path: {:?}", path.as_ref()); - if let Some(p) = path.as_ref().file_name().and_then(OsStr::to_str).map(String::from) { + if let Some(p) = path.as_ref().file_stem().and_then(OsStr::to_str).map(String::from) { debug!("Found UUID string: '{}'", p); Uuid::parse_str(&p) .map_err(CE::from)