Better scope printout.

This commit is contained in:
Stephen Chung 2020-10-09 13:22:40 +08:00
parent a4b674d015
commit 68493416f1

View File

@ -114,10 +114,14 @@ fn main() {
} }
"exit" | "quit" => break, // quit "exit" | "quit" => break, // quit
"scope" => { "scope" => {
scope.iter_raw().enumerate().for_each(|(i, (name, value))| { scope
.iter_raw()
.enumerate()
.for_each(|(i, (name, constant, value))| {
println!( println!(
"[{}] {}{} = {:?}", "[{}] {}{}{} = {:?}",
i + 1, i + 1,
if constant { "const " } else { "" },
name, name,
if value.is_shared() { " (shared)" } else { "" }, if value.is_shared() { " (shared)" } else { "" },
*value.read_lock::<Dynamic>().unwrap(), *value.read_lock::<Dynamic>().unwrap(),