diff options
Diffstat (limited to 'tvix/eval/src/value/string.rs')
-rw-r--r-- | tvix/eval/src/value/string.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tvix/eval/src/value/string.rs b/tvix/eval/src/value/string.rs index d146ee4cec95..4caef653f2cc 100644 --- a/tvix/eval/src/value/string.rs +++ b/tvix/eval/src/value/string.rs @@ -1,5 +1,6 @@ //! This module implements Nix language strings and their different //! backing implementations. +use rnix::ast; use smol_str::SmolStr; use std::ffi::OsStr; use std::hash::Hash; @@ -55,6 +56,12 @@ impl From<SmolStr> for NixString { } } +impl From<ast::Ident> for NixString { + fn from(ident: ast::Ident) -> Self { + ident.ident_token().unwrap().text().into() + } +} + impl Hash for NixString { fn hash<H: std::hash::Hasher>(&self, state: &mut H) { self.as_str().hash(state) |