ormlite
ormlite copied to clipboard
derive Clone for Join
Please note that this will break code like this because calls to clone
and to_owned
will no longer be dereferenced:
#[derive(Debug, Model)]
struct A {
id: Uuid,
#[ormlite(join_column = "b")]
b: Join<B>
}
#[derive(Clone, Debug, Model)]
struct B {
id: Uuid,
}
fn hi(a: A) {
// no longer works
let x: B = a.b.to_owned();
// now works
let y: Join<B> = a.b.to_owned();
// still works
let z: B = (*a.b).to_owned();
}
Can you provide a rationale and example code for why you'd want to Clone
a Join
struct? My mental model is that it's owned by the queried object, and never lives elsewhere. Definitely happy to include it if it makes sense, just concerned it might also lead to mistakes where users think they're updating the values, but it was only the clone that was updated.