Skip to content

Commit bb6ab41

Browse files
committed
Fix Pin example from dangerous implicit autorefs
1 parent 12f1ea5 commit bb6ab41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/pin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@
676676
//! let data_ptr = unpinned_src.data.as_ptr() as *const u8;
677677
//! let slice_ptr = unpinned_src.slice.as_ptr() as *const u8;
678678
//! let offset = slice_ptr.offset_from(data_ptr) as usize;
679-
//! let len = (*unpinned_src.slice.as_ptr()).len();
679+
//! let len = unpinned_src.slice.as_ptr().len();
680680
//!
681681
//! unpinned_self.slice = NonNull::from(&mut unpinned_self.data[offset..offset+len]);
682682
//! }

0 commit comments

Comments
 (0)