Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reword description about struct-wrapping #255

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/first-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,15 +312,15 @@ Rust is mad at us again. We marked the `List` as public (because we want people
to be able to use it), but not the `Node`. The problem is that the internals of
an `enum` are totally public, and we're not allowed to publicly talk about
private types. We could make all of `Node` totally public, but generally in Rust
we favour keeping implementation details private. Let's make `List` a struct, so
we favour keeping implementation details private. Let's wrap `List` inside a struct, so
that we can hide the implementation details:

```rust ,ignore
pub struct List {
pub struct List { // our new wrapper struct
head: Link,
}

enum Link {
enum Link { // previously known as List
Empty,
More(Box<Node>),
}
Expand Down