From 8455520e37d0c37397942f60271c0eca981d862d Mon Sep 17 00:00:00 2001 From: Lucien Greathouse Date: Fri, 2 Jul 2021 16:02:29 -0400 Subject: [PATCH] Update to rbx-dom 2.0 ecosystem --- CHANGELOG.md | 2 +- Cargo.lock | 24 ++++++++++++------------ Cargo.toml | 10 +++++----- src/remodel_api/remodel.rs | 17 ++++++++--------- 4 files changed, 26 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20b12b0..5125f5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Remodel Changelog ## Unreleased Changes - +* Updated to rbx-dom 2.0 ecosystem. * Added Instance:GetFullName() ([#49](https://github.com/rojo-rbx/remodel/pull/49)) * Added `Instance:FindFirstChildOfClass()` ([#50](https://github.com/rojo-rbx/remodel/pull/50)) * Added support for CFrame ([#48](https://github.com/rojo-rbx/remodel/pull/48)) diff --git a/Cargo.lock b/Cargo.lock index 245e3cf..133bfba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1176,9 +1176,9 @@ dependencies = [ [[package]] name = "rbx_binary" -version = "0.6.0-alpha.4" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ca5a20fa40e410431e623aac716f1b981554ca4f7e794cacbf308a80641718" +checksum = "032bfc7b1c68c00c003be8529b68e21ef24ecc6be49a6e765f01275648d8a772" dependencies = [ "log", "lz4", @@ -1190,9 +1190,9 @@ dependencies = [ [[package]] name = "rbx_dom_weak" -version = "2.0.0-alpha.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffa16d4ae69867cbe305d740790900193147ce5a904fc583f88dbfc7de43a95" +checksum = "d9fd3820420f2b69c1c359528fc21ce9db9ac198ffa130f2da0f7ad1d6797670" dependencies = [ "rbx_types", "serde", @@ -1200,9 +1200,9 @@ dependencies = [ [[package]] name = "rbx_reflection" -version = "4.0.0-alpha.1" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c43632d239190aad5b9406a6f0df2233ae3b46489957dd6d11c4d6daa9046c5" +checksum = "5348f0072bca81d514808002a6464cb842128b48c36e2e8b07cd6d490eb12c82" dependencies = [ "rbx_types", "serde", @@ -1210,9 +1210,9 @@ dependencies = [ [[package]] name = "rbx_reflection_database" -version = "0.1.0+roblox-465" +version = "0.2.1+roblox-484" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc9eca1c8c2016cb7237c290a298799fdef45f30782e088d3c625945b0f273c" +checksum = "d82fd952a01a86f1e6e182e1bc5f31bead251b37c4200f3ac3ff0d5e0a49d5d7" dependencies = [ "lazy_static", "rbx_reflection", @@ -1222,9 +1222,9 @@ dependencies = [ [[package]] name = "rbx_types" -version = "0.3.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4094f41f16e2a79cb7760bd64ac6f9d7bfe704accb6261dbff4c8fc58dd10c8c" +checksum = "356392c22d20830a73601676dd81922236c2413a209ea9bcb974e22f8c280586" dependencies = [ "base64 0.11.0", "bitflags", @@ -1236,9 +1236,9 @@ dependencies = [ [[package]] name = "rbx_xml" -version = "0.12.0-alpha.4" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86e2277d678ea30609e6f383a8f34eabab7bb2f9d62144cbe400d179acea2d47" +checksum = "e8b52c5cdcd446dfb29cb534c58679868ddfa2c5f97d33ef8e32e72799895f63" dependencies = [ "base64 0.11.0", "log", diff --git a/Cargo.toml b/Cargo.toml index c2244e8..653e710 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,11 +20,11 @@ panic = "abort" panic = "abort" [dependencies] -rbx_binary = "0.6.0-alpha.4" -rbx_dom_weak = "2.0.0-alpha.1" -rbx_reflection = "4.0.0-alpha.1" -rbx_reflection_database = "0.1.0" -rbx_xml = "0.12.0-alpha.4" +rbx_binary = "0.6.1" +rbx_dom_weak = "2.1.0" +rbx_reflection = "4.1.0" +rbx_reflection_database = "0.2.1" +rbx_xml = "0.12.1" anyhow = "1.0.27" backtrace = "0.3.45" diff --git a/src/remodel_api/remodel.rs b/src/remodel_api/remodel.rs index e701a0a..36a5cdb 100644 --- a/src/remodel_api/remodel.rs +++ b/src/remodel_api/remodel.rs @@ -55,7 +55,7 @@ impl Remodel { path: &Path, ) -> rlua::Result { let file = BufReader::new(File::open(path).map_err(rlua::Error::external)?); - let source_tree = rbx_binary::from_reader_default(file).map_err(rlua::Error::external)?; + let source_tree = rbx_binary::from_reader(file).map_err(rlua::Error::external)?; Remodel::import_tree_root(context, source_tree) } @@ -66,7 +66,7 @@ impl Remodel { ) -> rlua::Result> { let file = BufReader::new(File::open(path).map_err(rlua::Error::external)?); - let source_tree = rbx_binary::from_reader_default(file) + let source_tree = rbx_binary::from_reader(file) .map_err(|err| rlua::Error::external(format!("{:?}", err)))?; Remodel::import_tree_children(context, source_tree) @@ -150,8 +150,7 @@ impl Remodel { )); } - rbx_binary::to_writer_default(file, &tree, instance.children()) - .map_err(rlua::Error::external)?; + rbx_binary::to_writer(file, &tree, instance.children()).map_err(rlua::Error::external)?; Ok(()) } @@ -188,7 +187,7 @@ impl Remodel { )); } - rbx_binary::to_writer_default(file, &tree, &[lua_instance.id]) + rbx_binary::to_writer(file, &tree, &[lua_instance.id]) .map_err(|err| rlua::Error::external(format!("{:?}", err))) } @@ -215,7 +214,7 @@ impl Remodel { let source_tree = match sniff_type(&body) { Some(DocumentType::Binary) => { - rbx_binary::from_reader_default(body.as_slice()).map_err(rlua::Error::external)? + rbx_binary::from_reader(body.as_slice()).map_err(rlua::Error::external)? } Some(DocumentType::Xml) => rbx_xml::from_reader(body.as_slice(), xml_decode_options()) @@ -260,7 +259,7 @@ impl Remodel { let source_tree = match sniff_type(&body) { Some(DocumentType::Binary) => { - rbx_binary::from_reader_default(body.as_slice()).map_err(rlua::Error::external)? + rbx_binary::from_reader(body.as_slice()).map_err(rlua::Error::external)? } Some(DocumentType::Xml) => rbx_xml::from_reader(body.as_slice(), xml_decode_options()) @@ -299,7 +298,7 @@ impl Remodel { } let mut buffer = Vec::new(); - rbx_binary::to_writer_default(&mut buffer, &tree, &[lua_instance.id]) + rbx_binary::to_writer(&mut buffer, &tree, &[lua_instance.id]) .map_err(rlua::Error::external)?; Remodel::upload_asset(context, buffer, asset_id) @@ -322,7 +321,7 @@ impl Remodel { } let mut buffer = Vec::new(); - rbx_binary::to_writer_default(&mut buffer, &tree, instance.children()) + rbx_binary::to_writer(&mut buffer, &tree, instance.children()) .map_err(rlua::Error::external)?; Remodel::upload_asset(context, buffer, asset_id)