From 5dff56d18a259c8088d1506179a7dbda89c388c1 Mon Sep 17 00:00:00 2001 From: Ramkarthik Krishnamurthy Date: Sat, 13 Jul 2024 14:53:16 +0530 Subject: [PATCH] Fixes it for both sides of the operator --- core/types.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/types.rs b/core/types.rs index e737b1278..30fdf6d85 100644 --- a/core/types.rs +++ b/core/types.rs @@ -93,11 +93,12 @@ impl std::ops::Add for OwnedValue { OwnedValue::Text(Rc::new(int_left.to_string() + &string_right.to_string())) } (OwnedValue::Text(string_left), OwnedValue::Float(float_right)) => { - let text_right = OwnedValue::Float(float_right).to_string(); - OwnedValue::Text(Rc::new(string_left.to_string() + &text_right)) + let string_right = OwnedValue::Float(float_right).to_string(); + OwnedValue::Text(Rc::new(string_left.to_string() + &string_right)) } (OwnedValue::Float(float_left), OwnedValue::Text(string_right)) => { - OwnedValue::Text(Rc::new(float_left.to_string() + &string_right.to_string())) + let string_left = OwnedValue::Float(float_left).to_string(); + OwnedValue::Text(Rc::new(string_left + &string_right.to_string())) } (lhs, OwnedValue::Null) => lhs, (OwnedValue::Null, rhs) => rhs,