Skip to content

Commit 695d9d4

Browse files
authored
Implement Clone and Copy for bevy_ptr's ConstNonNull for parity with NonNull (#22078)
# Objective Fixes #22059 ## Solution Just `#[derive(Clone, Copy)]` on `ConstNonNull` since it`s just a wrapper around `NonNull` which implements them ## Testing Just tested if it compiles and functions as it should
1 parent 617828c commit 695d9d4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/bevy_ptr/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ mod sealed {
161161
/// A newtype around [`NonNull`] that only allows conversion to read-only borrows or pointers.
162162
///
163163
/// This type can be thought of as the `*const T` to [`NonNull<T>`]'s `*mut T`.
164+
#[derive(Clone, Copy)]
164165
#[repr(transparent)]
165166
pub struct ConstNonNull<T: ?Sized>(NonNull<T>);
166167

0 commit comments

Comments
 (0)