common location

This commit is contained in:
Quaternions 2023-09-12 19:29:43 -07:00
parent 52d911a25a
commit e5cca9ed04

View File

@ -448,11 +448,11 @@ fn interactive() -> Result<(), Box<dyn std::error::Error>>{
} }
}; };
let location=get_full_name(&dom, script);
match source_action{ match source_action{
ScriptAction::Pass => println!("passed source location={}",get_full_name(&dom, script)), ScriptAction::Pass => println!("passed source location={}",location),
ScriptAction::Replace(replace_id)=>{ ScriptAction::Replace(replace_id)=>{
//replace the source //replace the source
let location=get_full_name(&dom, script);
if let (Some(replace_source),Some(replace_script))=(allowed_map.get(&replace_id),dom.get_by_ref_mut(script.referent())){ if let (Some(replace_source),Some(replace_script))=(allowed_map.get(&replace_id),dom.get_by_ref_mut(script.referent())){
replace_count+=1; replace_count+=1;
println!("replaced source id={} location={}",replace_id,location); println!("replaced source id={} location={}",replace_id,location);
@ -462,17 +462,17 @@ fn interactive() -> Result<(), Box<dyn std::error::Error>>{
} }
}, },
ScriptAction::Delete => { ScriptAction::Delete => {
println!("deleted source location={}",get_full_name(&dom, script)); println!("deleted source location={}",location);
replace_count+=1; replace_count+=1;
dom.destroy(script.referent()); dom.destroy(script.referent());
}, },
ScriptAction::Flag => { ScriptAction::Flag => {
println!("flagged source location={}",get_full_name(&dom, script)); println!("flagged source location={}",location);
fail_type=Interactive::Flagged; fail_type=Interactive::Flagged;
}, },
ScriptAction::Block => { ScriptAction::Block => {
block_count+=1; block_count+=1;
println!("blocked source location={}",get_full_name(&dom, script)); println!("blocked source location={}",location);
match fail_type{ match fail_type{
Interactive::Passed => fail_type=Interactive::Blocked, Interactive::Passed => fail_type=Interactive::Blocked,
_=>(), _=>(),