From 2e3f9ebee210f3d7ec112946d4bf626044bf0977 Mon Sep 17 00:00:00 2001 From: Jeff Date: Sat, 21 Oct 2023 18:31:46 -0400 Subject: [PATCH] Implement to_string tool --- src/abstract_tree/tool.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/abstract_tree/tool.rs b/src/abstract_tree/tool.rs index b0d375b..5e2ad09 100644 --- a/src/abstract_tree/tool.rs +++ b/src/abstract_tree/tool.rs @@ -364,7 +364,12 @@ impl AbstractTree for Tool { Ok(Value::String(json)) } - Tool::ToString(_) => todo!(), + Tool::ToString(expression) => { + let value = expression.run(source, context)?; + let string = value.to_string(); + + Ok(Value::String(string)) + } Tool::Bash(expressions) => { let mut command = Command::new("bash");