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

Fixed errors and improved readability #2968

Merged
merged 8 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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 nostarch/chapter02.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ on which variant an enum value is when the conditional is evaluated.
Chapter 6 will cover enums in more detail. The purpose of these `Result` types
is to encode error-handling information.

`Result`’s variants are `Ok` or `Err`. The `Ok` variant indicates the
operation was successful, and inside `Ok` is the successfully generated value.
The `Err` variant means the operation failed, and `Err` contains information
`Result`’s variants are `Ok` and `Err`. The `Ok` variant indicates that the
joeljosedev marked this conversation as resolved.
Show resolved Hide resolved
operation was successful, and it contains the successfully generated value.
The `Err` variant means the operation failed, and it contains information
about how or why the operation failed.

Values of the `Result` type, like values of any type, have methods defined on
Expand Down
2 changes: 1 addition & 1 deletion nostarch/chapter03.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ isn’t safely doing what you want it to do yet; they do *not* mean that you’r
not a good programmer! Experienced Rustaceans still get compiler errors.

The error message indicates that the cause of the error is that you `` cannot
assign twice to immutable variable `x` ``, because you tried to assign a second
assign twice to immutable variable ``, because you tried to assign a second
joeljosedev marked this conversation as resolved.
Show resolved Hide resolved
value to the immutable `x` variable.

It’s important that we get compile-time errors when we attempt to change a
Expand Down
4 changes: 2 additions & 2 deletions nostarch/chapter04.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ strings.
> data on the heap so you don’t run out of space are all problems that ownership
> addresses. Once you understand ownership, you won’t need to think about the
> stack and the heap very often, but knowing that the main purpose of ownership
> is to manage heap data can help explain why it works the way it does.
> is to manage heap data and can help explain why it works the way it does.
joeljosedev marked this conversation as resolved.
Show resolved Hide resolved

### Ownership Rules

Expand Down Expand Up @@ -150,7 +150,7 @@ understanding by introducing the `String` type.

To illustrate the rules of ownership, we need a data type that is more complex
than those we covered in the “Data Types” section of Chapter 3. The types
covered previously are all a known size, can be stored on the stack and popped
covered previously are all of a known size, can be stored on the stack and popped
joeljosedev marked this conversation as resolved.
Show resolved Hide resolved
off the stack when their scope is over, and can be quickly and trivially copied
to make a new, independent instance if another part of code needs to use the
same value in a different scope. But we want to look at data that is stored on
Expand Down