From 432ec11ea603e36282f1a5d2b930ac5042b647b7 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 17:25:01 -0700 Subject: [PATCH] fix write_dom --- src/main.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 352f8b2..9dfe3ae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -209,12 +209,12 @@ fn replace() -> Result<(), Box>{ for entry in std::fs::read_dir("maps/blocked")? { 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 mut write_dom = rbx_dom_weak::WeakDom::new(rbx_dom_weak::InstanceBuilder::empty()); - dom.clone_into_external(dom.root_ref(), &mut write_dom); + let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + let mut write_dom = rbx_binary::from_reader(input)?; let scripts = get_scripts(dom); @@ -307,11 +307,10 @@ fn interactive() -> Result<(), Box>{ let file_thing=entry?; println!("processing map={:?}",file_thing.file_name()); let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); - let dom = rbx_binary::from_reader(input)?; - let mut write_dom = rbx_dom_weak::WeakDom::new(rbx_dom_weak::InstanceBuilder::empty()); - dom.clone_into_external(dom.root_ref(), &mut write_dom); + let input = std::io::BufReader::new(std::fs::File::open(file_thing.path())?); + let mut write_dom = rbx_binary::from_reader(input)?; let scripts = get_scripts(dom);