Skip to content

Commit

Permalink
Use Self instead of RingBuffer<T>
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed Jan 6, 2022
1 parent f72446c commit 2780dc0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl<T> RingBuffer<T> {
// Create a (fat) pointer to a slice ...
let ptr: *mut [T] = core::ptr::slice_from_raw_parts_mut(ptr.cast::<T>(), capacity);
// ... and coerce it into our own dynamically sized type:
let ptr = ptr as *mut RingBuffer<T>;
let ptr = ptr as *mut Self;
// Safety: Null check has been done above
NonNull::new_unchecked(ptr)
};
Expand Down

0 comments on commit 2780dc0

Please sign in to comment.