Print arrays and maps with to_debug.

This commit is contained in:
Stephen Chung
2020-11-30 11:20:51 +08:00
parent 65a4ceb3be
commit 1004bca5b5
9 changed files with 113 additions and 19 deletions

View File

@@ -61,7 +61,7 @@ mod MyEnumModule {
}
}
// Printing
#[rhai(global, name = "to_string", name = "print", name = "debug")]
#[rhai(global, name = "to_string", name = "print", name = "to_debug", name = "debug")]
pub fn to_string(a: &mut MyEnum) -> String {
format!("{:?}", a))
}