Remove double wording in opaque type chapter

Fixes up some word soup I came across reading the chapter.
pull/487/head
Mats Jun Larsen 1 month ago
parent 5eb3cbdce3
commit 891932e3da
No known key found for this signature in database
GPG Key ID: 17C60B5359158F95

@ -912,8 +912,8 @@ By including at least one private field and no constructor,
we create an opaque type that we can't instantiate outside of this module. we create an opaque type that we can't instantiate outside of this module.
(A struct with no field could be instantiated by anyone.) (A struct with no field could be instantiated by anyone.)
We also want to use this type in FFI, so we have to add `#[repr(C)]`. We also want to use this type in FFI, so we have to add `#[repr(C)]`.
The marker ensures the compiler does not mark the struct as `Send`, `Sync` and `Unpin` are The marker ensures the compiler does not mark the struct as `Send`, `Sync`, and
not applied to the struct. (`*mut u8` is not `Send` or `Sync`, `PhantomPinned` is not `Unpin`) `Unpin`. (`*mut u8` is not `Send` or `Sync`, `PhantomPinned` is not `Unpin`)
But because our `Foo` and `Bar` types are But because our `Foo` and `Bar` types are
different, well get type safety between the two of them, so we cannot different, well get type safety between the two of them, so we cannot

Loading…
Cancel
Save