refact: Resolve some clippy warnings

(cherry picked from commit dc4bfaa993eb2d712d53f70551db9ac34b0cda08)
This commit is contained in:
Robert Hensing 2024-11-27 10:26:39 +01:00
parent 12d3d62108
commit 1e3cce7742
5 changed files with 15 additions and 14 deletions

View file

@ -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(),
})
})

View file

@ -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