Skip to content

Commit

Permalink
Merge pull request #847 from wasmx/clippy
Browse files Browse the repository at this point in the history
rust: Improvement in CostNonNull suggested by clippy
  • Loading branch information
axic committed Mar 3, 2023
2 parents 630cca9 + 1c68e7d commit 6b39221
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bindings/rust/src/constnonnull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ pub(crate) struct ConstNonNull<T: ?Sized> {
}

impl<T: ?Sized> ConstNonNull<T> {
/// # Safety
/// The caller must guarantee that `ptr` is non-null.
#[inline]
pub const unsafe fn new_unchecked(ptr: *const T) -> Self {
// SAFETY: the caller must guarantee that `ptr` is non-null.
unsafe { ConstNonNull { pointer: ptr } }
ConstNonNull { pointer: ptr }
}

#[must_use]
Expand Down

0 comments on commit 6b39221

Please sign in to comment.