diff options
Diffstat (limited to 'tvix/cli/src')
-rw-r--r-- | tvix/cli/src/lib.rs | 8 | ||||
-rw-r--r-- | tvix/cli/src/repl.rs | 7 |
2 files changed, 9 insertions, 6 deletions
diff --git a/tvix/cli/src/lib.rs b/tvix/cli/src/lib.rs index 7686cc2c0fe8..2351da13a771 100644 --- a/tvix/cli/src/lib.rs +++ b/tvix/cli/src/lib.rs @@ -1,5 +1,7 @@ -use std::{collections::HashMap, path::PathBuf, rc::Rc}; +use std::path::PathBuf; +use std::rc::Rc; +use rustc_hash::FxHashMap; use smol_str::SmolStr; use std::fmt::Write; use tracing::{instrument, Span}; @@ -86,7 +88,7 @@ pub fn evaluate( path: Option<PathBuf>, args: &Args, allow_incomplete: AllowIncomplete, - env: Option<&HashMap<SmolStr, Value>>, + env: Option<&FxHashMap<SmolStr, Value>>, globals: Option<Rc<GlobalsMap>>, source_map: Option<SourceCode>, ) -> Result<EvalResult, IncompleteInput> { @@ -218,7 +220,7 @@ pub fn interpret( args: &Args, explain: bool, allow_incomplete: AllowIncomplete, - env: Option<&HashMap<SmolStr, Value>>, + env: Option<&FxHashMap<SmolStr, Value>>, globals: Option<Rc<GlobalsMap>>, source_map: Option<SourceCode>, ) -> Result<InterpretResult, IncompleteInput> { diff --git a/tvix/cli/src/repl.rs b/tvix/cli/src/repl.rs index 601b639154a6..e4b499609829 100644 --- a/tvix/cli/src/repl.rs +++ b/tvix/cli/src/repl.rs @@ -1,6 +1,7 @@ +use std::path::PathBuf; use std::rc::Rc; -use std::{collections::HashMap, path::PathBuf}; +use rustc_hash::FxHashMap; use rustyline::{error::ReadlineError, Editor}; use smol_str::SmolStr; use tvix_eval::{GlobalsMap, SourceCode, Value}; @@ -88,7 +89,7 @@ pub struct Repl<'a> { multiline_input: Option<String>, rl: Editor<()>, /// Local variables defined at the top-level in the repl - env: HashMap<SmolStr, Value>, + env: FxHashMap<SmolStr, Value>, io_handle: Rc<TvixStoreIO>, args: &'a Args, @@ -102,7 +103,7 @@ impl<'a> Repl<'a> { Self { multiline_input: None, rl, - env: HashMap::new(), + env: FxHashMap::default(), io_handle, args, source_map: Default::default(), |