refact: Resolve some clippy warnings
(cherry picked from commit dc4bfaa993eb2d712d53f70551db9ac34b0cda08)
This commit is contained in:
parent
12d3d62108
commit
1e3cce7742
5 changed files with 15 additions and 14 deletions
|
|
@ -52,8 +52,8 @@ impl EvalStateWeak {
|
|||
pub fn upgrade(&self) -> Option<EvalState> {
|
||||
self.inner.upgrade().and_then(|eval_state| {
|
||||
self.store.upgrade().map(|store| EvalState {
|
||||
eval_state: eval_state,
|
||||
store: store,
|
||||
eval_state,
|
||||
store,
|
||||
context: Context::new(),
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -55,10 +55,7 @@ impl PrimOp {
|
|||
// TODO: Use the GC with finalizer, if possible.
|
||||
let user_data = ManuallyDrop::new(Box::new(PrimOpContext {
|
||||
arity: N,
|
||||
function: Box::new(move |eval_state, args| {
|
||||
let r = f(eval_state, args.try_into().unwrap());
|
||||
r
|
||||
}),
|
||||
function: Box::new(move |eval_state, args| f(eval_state, args.try_into().unwrap())),
|
||||
eval_state: eval_state.weak_ref(),
|
||||
}));
|
||||
user_data.as_ref() as *const PrimOpContext as *mut c_void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue