refactor(tvix/eval) s/NixPath/NixSearchPath/

Since NixString is the Rust type for nix strings, people might
mistake NixPath for the Rust type of nix paths, which it is not.
Let's call it NixSearchPath instead.

Signed-off-by: Adam Joseph <adam@westernsemico.com>
Change-Id: Ib2ea155c4b27cb90d6180a04ea7b951d86607373
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6927
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
Adam Joseph 2022-10-10 11:43:51 -07:00
parent 04fccd89a5
commit 32ac7d6c6d
5 changed files with 49 additions and 46 deletions

View file

@ -3,7 +3,7 @@ use std::{cell::RefCell, path::PathBuf, rc::Rc};
use crate::{
builtins::global_builtins,
errors::{Error, ErrorKind, EvalResult},
nix_path::NixPath,
nix_search_path::NixSearchPath,
observer::{DisassemblingObserver, NoOpObserver, TracingObserver},
value::Value,
SourceCode,
@ -27,7 +27,7 @@ pub struct Options {
/// A colon-separated list of directories to use to resolve `<...>`-style paths
#[cfg_attr(feature = "repl", clap(long, short = 'I', env = "NIX_PATH"))]
nix_path: Option<NixPath>,
nix_search_path: Option<NixSearchPath>,
}
pub fn interpret(code: &str, location: Option<PathBuf>, options: Options) -> EvalResult<Value> {
@ -111,13 +111,13 @@ pub fn interpret(code: &str, location: Option<PathBuf>, options: Options) -> Eva
let result = if options.trace_runtime {
crate::vm::run_lambda(
options.nix_path.unwrap_or_default(),
options.nix_search_path.unwrap_or_default(),
&mut TracingObserver::new(std::io::stderr()),
result.lambda,
)
} else {
crate::vm::run_lambda(
options.nix_path.unwrap_or_default(),
options.nix_search_path.unwrap_or_default(),
&mut NoOpObserver::default(),
result.lambda,
)