From 52b7a762681fb04ae9387c2f1951a36bf83ebc79 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 27 Feb 2023 13:44:06 +0300 Subject: chore(tvix/eval): remove `From for NixString` instance No longer needed, and in some cases caused some extra work. Change-Id: I64e8e7292573bdc92a9c7a8e470e33f8c526f311 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8152 Reviewed-by: raitobezarius Tested-by: BuildkiteCI --- tvix/eval/src/builtins/impure.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tvix/eval/src/builtins') diff --git a/tvix/eval/src/builtins/impure.rs b/tvix/eval/src/builtins/impure.rs index f4bf400338ee..adf43e1a2ea9 100644 --- a/tvix/eval/src/builtins/impure.rs +++ b/tvix/eval/src/builtins/impure.rs @@ -1,6 +1,5 @@ use builtin_macros::builtins; use genawaiter::rc::Gen; -use smol_str::SmolStr; use std::{ env, @@ -12,7 +11,7 @@ use crate::{ io::FileType, value::NixAttrs, vm::generators::{self, GenCo}, - Value, + NixString, Value, }; #[builtins] @@ -38,14 +37,14 @@ mod impure_builtins { let dir = generators::request_read_dir(&co, path).await; let res = dir.into_iter().map(|(name, ftype)| { ( - name, + NixString::from(name.as_str()), Value::String( - SmolStr::new(match ftype { + match ftype { FileType::Directory => "directory", FileType::Regular => "regular", FileType::Symlink => "symlink", FileType::Unknown => "unknown", - }) + } .into(), ), ) -- cgit 1.4.1