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<u8>` instead of cloning the inner type
   --> simulator/main.rs:349:68
    |
349 |                         limbo_core::Value::Blob(b) => Value::Blob(b.clone().to_owned()),
This commit is contained in:
Pekka Enberg
2024-11-20 09:04:56 +02:00
parent de40442677
commit a3078079b4

View File

@@ -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);
}