Merge pull request #1333 from matthiasbeyer/libimagcontact/fix-uuid-fetching

Fix: use Path::file_stem() instead of Path::file_name()
This commit is contained in:
Matthias Beyer 2018-03-12 14:17:46 +01:00 committed by GitHub
commit 0977fe5c36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,7 +51,7 @@ impl UniqueRefPathGenerator for UniqueContactPathGenerator {
fn unique_hash<A: AsRef<Path>>(path: A) -> RResult<String, Self::Error> {
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)