Hide is_shared and is_locked under feature gates.

This commit is contained in:
Stephen Chung
2021-04-17 12:03:29 +08:00
parent 6eaee57578
commit 6c92011ea1
7 changed files with 52 additions and 18 deletions

View File

@@ -205,12 +205,17 @@ fn main() {
.iter_raw()
.enumerate()
.for_each(|(i, (name, constant, value))| {
#[cfg(not(feature = "no_closure"))]
let value_is_shared = if value.is_shared() { " (shared" } else { "" };
#[cfg(feature = "no_closure")]
let value_is_shared = "";
println!(
"[{}] {}{}{} = {:?}",
i + 1,
if constant { "const " } else { "" },
name,
if value.is_shared() { " (shared)" } else { "" },
value_is_shared,
*value.read_lock::<Dynamic>().unwrap(),
)
});