diff --git a/Cargo.lock b/Cargo.lock index f34ebac..06fc89c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -533,7 +533,7 @@ dependencies = [ [[package]] name = "yrb" -version = "0.5.4" +version = "0.5.5" dependencies = [ "magnus", "rb-sys", diff --git a/ext/yrb/Cargo.toml b/ext/yrb/Cargo.toml index b7050dd..7b655db 100644 --- a/ext/yrb/Cargo.toml +++ b/ext/yrb/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "yrb" -version = "0.5.4" +version = "0.5.5" authors = ["Hannes Moser "] edition = "2021" homepage = "https://github.com/y-crdt/yrb" repository = "https://github.com/y-crdt/yrb" [dependencies] -magnus = "0.6.2" +magnus = "=0.6.2" thiserror = "1.0.57" yrs = "=0.17.4" y-sync = "=0.4.0" diff --git a/ext/yrb/src/yany.rs b/ext/yrb/src/yany.rs index b2a4dd8..e3c039f 100644 --- a/ext/yrb/src/yany.rs +++ b/ext/yrb/src/yany.rs @@ -35,11 +35,11 @@ impl TryInto for YAny { Ok(hash.as_value()) } Any::Null => Ok(value::qnil().as_value()), - Any::Undefined => Ok(Value::from(value::qnil().as_value())), + Any::Undefined => Ok(value::qnil().as_value()), Any::Bool(v) => Ok(v.into_value()), - Any::Number(v) => Ok(Value::from(v.into_value())), - Any::BigInt(v) => Ok(Value::from(v.into_value())), - Any::String(v) => Ok(RString::from(v.into_r_string()).as_value()), + Any::Number(v) => Ok(v.into_value()), + Any::BigInt(v) => Ok(v.into_value()), + Any::String(v) => Ok(v.into_r_string().as_value()), Any::Buffer(v) => Ok(RString::from_slice(v.borrow()).as_value()), }; } diff --git a/ext/yrb/src/yarray.rs b/ext/yrb/src/yarray.rs index bb5583c..bdf9fc3 100644 --- a/ext/yrb/src/yarray.rs +++ b/ext/yrb/src/yarray.rs @@ -174,7 +174,7 @@ impl YArray { let r_arr = RArray::new(); for item in arr.iter(tx) { let r_val = YValue::from(item); - let r_val = r_val.0.borrow().clone(); + let r_val = *r_val.0.borrow(); r_arr.push(r_val).expect("cannot push item event to array"); } r_arr diff --git a/ext/yrb/src/ydoc.rs b/ext/yrb/src/ydoc.rs index 248cbdc..24e31e5 100644 --- a/ext/yrb/src/ydoc.rs +++ b/ext/yrb/src/ydoc.rs @@ -89,7 +89,7 @@ impl YDoc { YXmlText::from(xml_text_ref) } - pub(crate) fn ydoc_transact<'doc>(&self) -> YTransaction { + pub(crate) fn ydoc_transact(&self) -> YTransaction { let doc = self.0.borrow(); let transaction = doc.transact_mut(); YTransaction::from(transaction) diff --git a/ext/yrb/src/yvalue.rs b/ext/yrb/src/yvalue.rs index 3bc823b..a8120c2 100644 --- a/ext/yrb/src/yvalue.rs +++ b/ext/yrb/src/yvalue.rs @@ -125,7 +125,7 @@ impl From for YValue { let arr = RArray::new(); for item in v.iter() { let val = YValue::from(item.clone()); - let val = val.0.borrow().clone(); + let val = *val.0.borrow(); arr.push(val).expect("cannot push item event to array"); } YValue::from(arr) diff --git a/ext/yrb/src/yxml_element.rs b/ext/yrb/src/yxml_element.rs index 7027a24..0a8228b 100644 --- a/ext/yrb/src/yxml_element.rs +++ b/ext/yrb/src/yxml_element.rs @@ -116,7 +116,7 @@ impl YXmlElement { let values = RArray::new(); for value in v.iter() { let value = YValue::from(value.clone()); - let value = value.0.borrow().clone(); + let value = *value.0.borrow(); values.push(value).expect("cannot push value to array"); } diff --git a/lib/y/version.rb b/lib/y/version.rb index 6bc4b09..21b855f 100644 --- a/lib/y/version.rb +++ b/lib/y/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Y - VERSION = "0.5.4" + VERSION = "0.5.5" end