Skip to content
This repository has been archived by the owner on Jul 22, 2023. It is now read-only.

Commit

Permalink
Update to rbx-dom 2.0 ecosystem
Browse files Browse the repository at this point in the history
  • Loading branch information
LPGhatguy committed Jul 2, 2021
1 parent 5e644ed commit 8455520
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 27 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
17 changes: 8 additions & 9 deletions src/remodel_api/remodel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl Remodel {
path: &Path,
) -> rlua::Result<LuaInstance> {
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)
}
Expand All @@ -66,7 +66,7 @@ impl Remodel {
) -> rlua::Result<Vec<LuaInstance>> {
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)
Expand Down Expand Up @@ -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(())
}
Expand Down Expand Up @@ -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)))
}

Expand All @@ -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())
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 8455520

Please sign in to comment.