Skip to content

Commit 9734df2

Browse files
authored
Merge pull request #19 from dswij/patch-1
fix syntax on pin-init rust code example
2 parents 4864d53 + 582e154 commit 9734df2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/The-Safe-Pinned-Initialization-Problem.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ impl ListHead {
5050
/// # Safety
5151
///
5252
/// Before using this [`ListHead`] the caller has to call [`ListHead::init`].
53-
unsafe fn new() -> ListHead {
54-
ListHead {
53+
unsafe fn new() -> Self {
54+
Self {
5555
next: ptr::null_mut(),
5656
prev: ptr::null_mut(),
5757
}
@@ -86,8 +86,8 @@ impl DoubleList {
8686
/// # Safety
8787
///
8888
/// Before using this [`DoubleList`] the caller has to call [`DoubleList::init`].
89-
unsafe fn new() -> ListHead {
90-
DoubleList {
89+
unsafe fn new() -> Self {
90+
Self {
9191
// SAFETY: We call `ListHead::init` in our own initializer.
9292
list_a: unsafe { ListHead::new() },
9393
// SAFETY: We call `ListHead::init` in our own initializer.

0 commit comments

Comments
 (0)