From 8538874dd382019c482de02a75ed0a02772db2fb Mon Sep 17 00:00:00 2001 From: kyren Date: Mon, 1 Oct 2018 05:31:28 -0400 Subject: [PATCH] Whoops, misplaced assert --- examples/guided_tour.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/guided_tour.rs b/examples/guided_tour.rs index 03a1f8b..292b0c0 100644 --- a/examples/guided_tour.rs +++ b/examples/guided_tour.rs @@ -170,14 +170,14 @@ fn main() -> Result<()> { lua.eval::<()>("sketchy()", None) })?; + + assert_eq!(rust_val, 42); } // We were able to run our 'sketchy' function inside the scope just fine. However, if we try to // run our 'sketchy' function outside of the scope, the function we created will have been // invalidated and we will generate an error. If our function wasn't invalidated, we might be // able to improperly access the destroyed `rust_val` which would be unsafe. - - assert_eq!(rust_val, 42); assert!(lua.eval::<()>("sketchy()", None).is_err()); Ok(())