diff --git a/src/definition.rs b/src/definition.rs index 148de3ca..1da9054f 100644 --- a/src/definition.rs +++ b/src/definition.rs @@ -318,7 +318,7 @@ impl RocksStorage { let name = vs.next().unwrap().get_string().unwrap().to_string(); let typ = vs.next().unwrap().get_string().unwrap(); let typ = env.build_type_from_str(&typ).unwrap(); - let default = vs.next().unwrap().to_owned(); + let default = vs.next().unwrap().owned_clone(); Col { name, typ, @@ -332,7 +332,7 @@ impl RocksStorage { let name = vs.next().unwrap().get_string().unwrap().to_string(); let typ = vs.next().unwrap().get_string().unwrap(); let typ = env.build_type_from_str(&typ).unwrap(); - let default = vs.next().unwrap().to_owned(); + let default = vs.next().unwrap().owned_clone(); Col { name, typ, @@ -362,7 +362,7 @@ impl RocksStorage { let name = vs.next().unwrap().get_string().unwrap().to_string(); let typ = vs.next().unwrap().get_string().unwrap(); let typ = env.build_type_from_str(&typ).unwrap(); - let default = vs.next().unwrap().to_owned(); + let default = vs.next().unwrap().owned_clone(); Col { name, typ, @@ -376,7 +376,7 @@ impl RocksStorage { let name = vs.next().unwrap().get_string().unwrap().to_string(); let typ = vs.next().unwrap().get_string().unwrap(); let typ = env.build_type_from_str(&typ).unwrap(); - let default = vs.next().unwrap().to_owned(); + let default = vs.next().unwrap().owned_clone(); Col { name, typ, diff --git a/src/mutation.rs b/src/mutation.rs index 4c0f3f27..b18ef0e6 100644 --- a/src/mutation.rs +++ b/src/mutation.rs @@ -87,7 +87,7 @@ mod tests { _ => unreachable!() }; eval.env.push(); - eval.env.define("$data".to_string(), Structured::Value(bound_value.to_owned())); + eval.env.define("$data".to_string(), Structured::Value(bound_value.owned_clone())); eval.eval_mutation(insert_stmt.next().unwrap()).unwrap(); // println!("{:#?}", evaluated); eval.env.pop(); diff --git a/src/value.rs b/src/value.rs index 29642008..c82f6269 100644 --- a/src/value.rs +++ b/src/value.rs @@ -506,7 +506,7 @@ pub fn cmp_data<'a>(pa: &mut ByteArrayParser<'a>, pb: &mut ByteArrayParser<'a>) impl<'a> Value<'a> { - pub fn to_owned(&self) -> Value<'static> { + pub fn owned_clone(&self) -> Value<'static> { use Value::*; match self { @@ -522,7 +522,7 @@ impl<'a> Value<'a> { let mut inner = Vec::with_capacity(l.len()); for el in l.iter() { - inner.push(el.clone().to_owned()) + inner.push(el.owned_clone()) } List(Rc::new(inner)) } @@ -530,7 +530,7 @@ impl<'a> Value<'a> { let mut inner = BTreeMap::new(); for (k, v) in d.iter() { let new_k = Cow::from(k.clone().into_owned()); - inner.insert(new_k, v.clone().to_owned()); + inner.insert(new_k, v.owned_clone()); } Dict(Rc::new(inner)) }