From a3078079b4a80ccbd9ba9719b7cb0a9381d8319c Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Wed, 20 Nov 2024 09:04:56 +0200 Subject: [PATCH] simulator: Fix clone() on double reference Switch to to_string() and to_vec() instead of clone() + to_owned() to fix the following warnings: warning: using `.clone()` on a double reference, which returns `&String` instead of cloning the inner type --> simulator/main.rs:348:68 | 348 | limbo_core::Value::Text(t) => Value::Text(t.clone().to_owned()), | ^^^^^^^^ | = note: `#[warn(suspicious_double_ref_op)]` on by default warning: using `.clone()` on a double reference, which returns `&Vec` instead of cloning the inner type --> simulator/main.rs:349:68 | 349 | limbo_core::Value::Blob(b) => Value::Blob(b.clone().to_owned()), --- simulator/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simulator/main.rs b/simulator/main.rs index bbb9b8bc1..3b7492cb1 100644 --- a/simulator/main.rs +++ b/simulator/main.rs @@ -345,8 +345,8 @@ fn get_all_rows( limbo_core::Value::Null => Value::Null, limbo_core::Value::Integer(i) => Value::Integer(*i), limbo_core::Value::Float(f) => Value::Float(*f), - limbo_core::Value::Text(t) => Value::Text(t.clone().to_owned()), - limbo_core::Value::Blob(b) => Value::Blob(b.clone().to_owned()), + limbo_core::Value::Text(t) => Value::Text(t.to_string()), + limbo_core::Value::Blob(b) => Value::Blob(b.to_vec()), }; r.push(v); }