From de6c8b75467168ee608eba0b08ba8847946814cc Mon Sep 17 00:00:00 2001 From: Ryan Lahfa Date: Fri, 29 Dec 2023 19:18:08 +0100 Subject: feat(tvix/cli): context-aware raw printing Raw printing will transform the result into a string and print it. In case of a contextful string, this will fail by default, as expected. Change-Id: I5e564329e7b001adc57a77a9153b4425cb332bb7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10457 Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/cli/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tvix/cli') diff --git a/tvix/cli/src/main.rs b/tvix/cli/src/main.rs index 17632cad1a..acaf5c7eab 100644 --- a/tvix/cli/src/main.rs +++ b/tvix/cli/src/main.rs @@ -213,7 +213,7 @@ fn run_file(mut path: PathBuf, args: &Args) { fn println_result(result: &Value, raw: bool) { if raw { - println!("{}", result.to_str().unwrap().as_str()) + println!("{}", result.to_contextful_str().unwrap().as_str()) } else { println!("=> {} :: {}", result, result.type_of()) } -- cgit 1.4.1