fix write_dom

This commit is contained in:
Quaternions 2023-09-12 17:25:01 -07:00
parent 01449b1850
commit 432ec11ea6

View File

@ -209,12 +209,12 @@ fn replace() -> Result<(), Box<dyn std::error::Error>>{
for entry in std::fs::read_dir("maps/blocked")? { for entry in std::fs::read_dir("maps/blocked")? {
let file_thing=entry?; let file_thing=entry?;
let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?);
let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?);
let dom = rbx_binary::from_reader(input)?; let dom = rbx_binary::from_reader(input)?;
let mut write_dom = rbx_dom_weak::WeakDom::new(rbx_dom_weak::InstanceBuilder::empty()); let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?);
dom.clone_into_external(dom.root_ref(), &mut write_dom); let mut write_dom = rbx_binary::from_reader(input)?;
let scripts = get_scripts(dom); let scripts = get_scripts(dom);
@ -307,11 +307,10 @@ fn interactive() -> Result<(), Box<dyn std::error::Error>>{
let file_thing=entry?; let file_thing=entry?;
println!("processing map={:?}",file_thing.file_name()); println!("processing map={:?}",file_thing.file_name());
let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?);
let dom = rbx_binary::from_reader(input)?; let dom = rbx_binary::from_reader(input)?;
let mut write_dom = rbx_dom_weak::WeakDom::new(rbx_dom_weak::InstanceBuilder::empty()); let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?);
dom.clone_into_external(dom.root_ref(), &mut write_dom); let mut write_dom = rbx_binary::from_reader(input)?;
let scripts = get_scripts(dom); let scripts = get_scripts(dom);