From ace04d6b393225249d9d8ae5a12c152e4c75117d Mon Sep 17 00:00:00 2001 From: dvvvvvv Date: Tue, 4 Feb 2020 22:57:29 +0900 Subject: [PATCH] use name as file name when file name None --- src/meta/name.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meta/name.rs b/src/meta/name.rs index ce431e4..2c9a48d 100644 --- a/src/meta/name.rs +++ b/src/meta/name.rs @@ -45,7 +45,7 @@ impl Name { } pub fn file_name(&self) -> &str { - self.path.file_name().and_then(OsStr::to_str).unwrap() + self.path.file_name().and_then(OsStr::to_str).unwrap_or(&self.name) } fn relative_path + Clone>(&self, base_path: T) -> PathBuf {