about summary refs log tree commit diff
path: root/tvix/castore/src/import/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/castore/src/import/mod.rs')
-rw-r--r--tvix/castore/src/import/mod.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/tvix/castore/src/import/mod.rs b/tvix/castore/src/import/mod.rs
index 9fce22585f60..a7c459fdb56a 100644
--- a/tvix/castore/src/import/mod.rs
+++ b/tvix/castore/src/import/mod.rs
@@ -123,9 +123,8 @@ where
                 .path()
                 .file_name()
                 // If this is the root node, it will have an empty name.
-                .unwrap_or_default()
-                .to_owned()
-                .into();
+                .unwrap_or_else(|| "".try_into().unwrap())
+                .to_owned();
 
             // record node in parent directory, creating a new [Directory] if not there yet.
             directories