about summary refs log tree commit diff
path: root/tvix/eval/src/value/string.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/value/string.rs')
-rw-r--r--tvix/eval/src/value/string.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/tvix/eval/src/value/string.rs b/tvix/eval/src/value/string.rs
index 876b1abe6b..d146ee4cec 100644
--- a/tvix/eval/src/value/string.rs
+++ b/tvix/eval/src/value/string.rs
@@ -1,6 +1,7 @@
 //! This module implements Nix language strings and their different
 //! backing implementations.
 use smol_str::SmolStr;
+use std::ffi::OsStr;
 use std::hash::Hash;
 use std::ops::Deref;
 use std::path::Path;
@@ -186,6 +187,12 @@ impl AsRef<str> for NixString {
     }
 }
 
+impl AsRef<OsStr> for NixString {
+    fn as_ref(&self) -> &OsStr {
+        self.as_str().as_ref()
+    }
+}
+
 impl AsRef<Path> for NixString {
     fn as_ref(&self) -> &Path {
         self.as_str().as_ref()