Use .take instead of mem::take().
This commit is contained in:
@@ -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();
|
||||
|
||||
|
@@ -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()])
|
||||
},
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user