From cad29af4bbb97678ce0de7cbd932860ceeac651a Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Sep 2023 17:02:05 -0700 Subject: [PATCH] panic lol --- src/main.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index f7cbc72..d4497ec 100644 --- a/src/main.rs +++ b/src/main.rs @@ -270,7 +270,6 @@ enum Interactive{ Passed, Blocked, Flagged, - ReplaceFailed, } enum ScriptAction { Pass, @@ -387,8 +386,7 @@ fn interactive() -> Result<(), Box>{ println!("replaced source id={} location={}",replace_id,location); replace_script.properties.insert("Source".to_string(), rbx_dom_weak::types::Variant::String(replace_source.clone())); }else{ - println!("failed to get replacement source id={} location={}",replace_id,location); - fail_type=Interactive::ReplaceFailed; + panic!("failed to get replacement source id={} location={}",replace_id,location); } } ScriptAction::Flag => { @@ -403,13 +401,14 @@ fn interactive() -> Result<(), Box>{ } }, } + }else{ + panic!("script source property is none!"); } } let mut dest=match fail_type{ Interactive::Passed => std::path::PathBuf::from("maps/processed"),//write map into maps/processed Interactive::Blocked => std::path::PathBuf::from("maps/blocked"),//write map into maps/blocked Interactive::Flagged => std::path::PathBuf::from("maps/flagged"),//write map into maps/flagged - Interactive::ReplaceFailed => continue,//do nothing, map is still unprocessed }; dest.push(file_thing.file_name()); std::fs::rename(file_thing.path(), dest)?;