change function name for less confusion

main
Ziyang Hu 2 years ago
parent cc60909a70
commit 54c9327941

@ -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,

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

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

Loading…
Cancel
Save