From 68493416f1c88856b893409e3d5934e735780323 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Fri, 9 Oct 2020 13:22:40 +0800 Subject: [PATCH] Better scope printout. --- examples/repl.rs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/examples/repl.rs b/examples/repl.rs index ee20c4c8..f97bc0ba 100644 --- a/examples/repl.rs +++ b/examples/repl.rs @@ -114,15 +114,19 @@ fn main() { } "exit" | "quit" => break, // quit "scope" => { - scope.iter_raw().enumerate().for_each(|(i, (name, value))| { - println!( - "[{}] {}{} = {:?}", - i + 1, - name, - if value.is_shared() { " (shared)" } else { "" }, - *value.read_lock::().unwrap(), - ) - }); + scope + .iter_raw() + .enumerate() + .for_each(|(i, (name, constant, value))| { + println!( + "[{}] {}{}{} = {:?}", + i + 1, + if constant { "const " } else { "" }, + name, + if value.is_shared() { " (shared)" } else { "" }, + *value.read_lock::().unwrap(), + ) + }); continue; } "astu" => {