address some clippy lints

This commit is contained in:
Dustin J. Mitchell
2022-02-13 03:30:02 +00:00
parent bbb7b64842
commit 51a854cfef
6 changed files with 46 additions and 45 deletions

View File

@@ -18,14 +18,14 @@ impl From<WorkingSet> for TCWorkingSet {
}
/// Utility function to get a shared reference to the underlying WorkingSet.
fn wrap<'a, T, F>(ws: *mut TCWorkingSet, f: F) -> T
fn wrap<T, F>(ws: *mut TCWorkingSet, f: F) -> T
where
F: FnOnce(&WorkingSet) -> T,
{
// SAFETY:
// - ws is not null (promised by caller)
// - ws outlives 'a (promised by caller)
let tcws: &'a TCWorkingSet = unsafe { TCWorkingSet::from_ptr_arg_ref(ws) };
let tcws: &TCWorkingSet = unsafe { TCWorkingSet::from_ptr_arg_ref(ws) };
f(&tcws.0)
}