Fix builds.

This commit is contained in:
Stephen Chung
2022-01-16 23:15:37 +08:00
parent e366bd2106
commit 57cfd6a354
4 changed files with 49 additions and 8 deletions

View File

@@ -17,18 +17,24 @@ fn print_scope(scope: &Scope) {
.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(),
)
});
println!();
}
#[cfg(not(feature = "no_function"))]
pub fn main() {
println!("Events Handler Example - Main Style");
println!("===================================");
@@ -127,3 +133,8 @@ pub fn main() {
println!("Bye!");
}
#[cfg(feature = "no_function")]
pub fn main() {
panic!("This example does not run under 'no_function'.")
}