refactor(tvix/eval): don't unnecessarily force in toString

Change-Id: I2bcc720ce7b6aa67ea5f145b1f2381a3ae833ac5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6691
Autosubmit: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
This commit is contained in:
sterni 2022-09-19 11:17:06 +02:00
parent 6576c2f15f
commit a01524823a

View file

@ -238,7 +238,8 @@ fn pure_builtins() -> Vec<Builtin> {
args.pop().unwrap().to_str()?.as_str().to_owned(),
));
}),
Builtin::new("toString", &[true], |args, vm| {
// coerce_to_string forces for us
Builtin::new("toString", &[false], |args, vm| {
args[0]
.coerce_to_string(CoercionKind::Strong, vm)
.map(Value::String)