Use .take instead of mem::take().

This commit is contained in:
Stephen Chung
2023-04-21 10:20:19 +08:00
parent 2034ddd830
commit f49ce33a88
14 changed files with 72 additions and 57 deletions

View File

@@ -175,7 +175,7 @@ fn test_fn_ptr_raw() -> Result<(), Box<EvalAltResult>> {
TypeId::of::<INT>(),
],
move |context, args| {
let fp = std::mem::take(args[1]).cast::<FnPtr>();
let fp = args[1].take().cast::<FnPtr>();
let value = args[2].clone();
let this_ptr = args.get_mut(0).unwrap();

View File

@@ -16,8 +16,8 @@ fn test_fn_ptr_curry_call() -> Result<(), Box<EvalAltResult>> {
"call_with_arg",
[TypeId::of::<FnPtr>(), TypeId::of::<INT>()],
|context, args| {
let fn_ptr = std::mem::take(args[0]).cast::<FnPtr>();
fn_ptr.call_raw(&context, None, [std::mem::take(args[1])])
let fn_ptr = args[0].take().cast::<FnPtr>();
fn_ptr.call_raw(&context, None, [args[1].take()])
},
);