diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 5b9160970..fe17d1efd 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -1,4 +1,5 @@ #![warn(unsafe_op_in_unsafe_fn)] +#![warn(clippy::undocumented_unsafe_blocks)] mod traits; mod util; diff --git a/lib/src/replica.rs b/lib/src/replica.rs index d393d95c2..efa5dcbc2 100644 --- a/lib/src/replica.rs +++ b/lib/src/replica.rs @@ -69,12 +69,12 @@ impl From for TCReplica { /// Utility function to allow using `?` notation to return an error value. This makes /// a mutable borrow, because most Replica methods require a `&mut`. -fn wrap<'a, T, F>(rep: *mut TCReplica, f: F, err_value: T) -> T +fn wrap(rep: *mut TCReplica, f: F, err_value: T) -> T where F: FnOnce(&mut Replica) -> anyhow::Result, { // SAFETY: see type docstring - let rep: &'a mut TCReplica = unsafe { TCReplica::from_arg_ref_mut(rep) }; + let rep: &mut TCReplica = unsafe { TCReplica::from_arg_ref_mut(rep) }; if rep.mut_borrowed { panic!("replica is borrowed and cannot be used"); } diff --git a/lib/src/util.rs b/lib/src/util.rs index bcab209ec..405a8b292 100644 --- a/lib/src/util.rs +++ b/lib/src/util.rs @@ -10,5 +10,5 @@ pub(crate) fn vec_into_raw_parts(vec: Vec) -> (*mut T, usize, usize) { // - disable dropping the Vec with ManuallyDrop // - extract ptr, len, and capacity using those methods let mut vec = std::mem::ManuallyDrop::new(vec); - return (vec.as_mut_ptr(), vec.len(), vec.capacity()); + (vec.as_mut_ptr(), vec.len(), vec.capacity()) }