diff options
Diffstat (limited to 'tvix/eval/src/value')
-rw-r--r-- | tvix/eval/src/value/attrs.rs | 1 | ||||
-rw-r--r-- | tvix/eval/src/value/function.rs | 2 | ||||
-rw-r--r-- | tvix/eval/src/value/mod.rs | 4 | ||||
-rw-r--r-- | tvix/eval/src/value/string.rs | 2 | ||||
-rw-r--r-- | tvix/eval/src/value/thunk.rs | 10 |
5 files changed, 9 insertions, 10 deletions
diff --git a/tvix/eval/src/value/attrs.rs b/tvix/eval/src/value/attrs.rs index ecce34fb4af4..833cb2fd6045 100644 --- a/tvix/eval/src/value/attrs.rs +++ b/tvix/eval/src/value/attrs.rs @@ -321,7 +321,6 @@ impl NixAttrs { } } - // TODO(tazjin): extend_reserve(count) (rust#72631) let mut attrs = NixAttrs(AttrsRep::Map(BTreeMap::new())); for _ in 0..count { diff --git a/tvix/eval/src/value/function.rs b/tvix/eval/src/value/function.rs index e31bb92b7931..1a32795393bf 100644 --- a/tvix/eval/src/value/function.rs +++ b/tvix/eval/src/value/function.rs @@ -30,7 +30,7 @@ impl Formals { Q: ?Sized + Hash + Eq, NixString: std::borrow::Borrow<Q>, { - self.ellipsis || self.arguments.contains_key(&arg) + self.ellipsis || self.arguments.contains_key(arg) } } diff --git a/tvix/eval/src/value/mod.rs b/tvix/eval/src/value/mod.rs index 124ce881d9a1..34dbf06231d4 100644 --- a/tvix/eval/src/value/mod.rs +++ b/tvix/eval/src/value/mod.rs @@ -217,7 +217,7 @@ impl Value { if let Value::Thunk(t) = f { t.force(vm)?; let guard = t.value(); - call_to_string(&*guard, vm) + call_to_string(&guard, vm) } else { call_to_string(f, vm) } @@ -451,7 +451,7 @@ impl Value { if let Some(name) = &f.lambda.name { format!("the user-defined Nix function '{}'", name) } else { - format!("a user-defined Nix function") + "a user-defined Nix function".to_string() } } diff --git a/tvix/eval/src/value/string.rs b/tvix/eval/src/value/string.rs index 66697a7f2f4f..5b2cb83a17de 100644 --- a/tvix/eval/src/value/string.rs +++ b/tvix/eval/src/value/string.rs @@ -172,7 +172,7 @@ fn is_valid_nix_identifier(s: &str) -> bool { _ => return false, } } - return true; + true } /// Escape a Nix string for display, as most user-visible representation diff --git a/tvix/eval/src/value/thunk.rs b/tvix/eval/src/value/thunk.rs index c7cdfa244183..8813b0039888 100644 --- a/tvix/eval/src/value/thunk.rs +++ b/tvix/eval/src/value/thunk.rs @@ -143,7 +143,7 @@ impl Thunk { }) => vm.enter_frame(lambda, upvalues, arg_count)?, } match trampoline.continuation { - None => break (), + None => break, Some(cont) => { trampoline = cont(vm)?; continue; @@ -203,7 +203,7 @@ impl Thunk { return Ok(Trampoline { action: Some(TrampolineAction::EnterFrame { lambda, - upvalues: upvalues.clone(), + upvalues, arg_count: 0, light_span: light_span.clone(), }), @@ -212,10 +212,10 @@ impl Thunk { self_clone.0.replace(ThunkRepr::Evaluated(vm.pop())); assert!(matches!(should_be_blackhole, ThunkRepr::Blackhole)); vm.push(Value::Thunk(self_clone)); - return Self::force_trampoline(vm).map_err(|kind| Error { + Self::force_trampoline(vm).map_err(|kind| Error { kind, span: light_span.span(), - }); + }) })), }); } @@ -268,7 +268,7 @@ impl Thunk { panic!("Thunk::value called on an unfinalised closure"); } */ - return value; + value } ThunkRepr::Blackhole => panic!("Thunk::value called on a black-holed thunk"), ThunkRepr::Suspended { .. } => panic!("Thunk::value called on a suspended thunk"), |