Change take_string and take_immutable_string to as_XXX.

This commit is contained in:
Stephen Chung
2021-06-10 10:45:44 +08:00
parent a5031969ca
commit 79d9977cd5
11 changed files with 62 additions and 31 deletions

View File

@@ -343,7 +343,7 @@ fn test_closures_external() -> Result<(), Box<EvalAltResult>> {
// Closure 'f' captures: the engine, the AST, and the curried function pointer
let f = move |x: INT| fn_ptr.call_dynamic(&context, None, [x.into()]);
assert_eq!(f(42)?.take_string(), Ok("hello42".to_string()));
assert_eq!(f(42)?.as_string(), Ok("hello42".to_string()));
Ok(())
}