Skip to content

Attempt to fix grammatically confusing sentence in this paragraph. #2936

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

Closed
wants to merge 2 commits into from

Conversation

darrow-olykos
Copy link

It is unclear to me what the original author was TRYING to say here, but this is my best guess.

It seems like they were trying to say "you can only access the i32 via .lock(), but the actual result of .lock() won't be an i32 value so Rust's type system ensures you actually acquire a lock before using the i32 value?

But I'm not actually sure.

It is unclear to me what the original author was TRYING to say here, but this is my best guess.

It seems like they were trying to say "you can only access the `i32` via `.lock()`, but the actual result of `.lock()` won't be an `i32` value so Rust's type system ensures you actually acquire a lock before using the `i32` value?

But I'm not actually sure.
@darrow-olykos darrow-olykos mentioned this pull request Dec 1, 2021
2 tasks
@carols10cents carols10cents added this to the ch16 milestone Dec 3, 2021
Co-authored-by: yjhn <54238857+yjhn@users.noreply.github.com>
@darrow-olykos
Copy link
Author

@carols10cents Hi there, is there anything else I could do to help get this change reviewed/merged in?

@carols10cents
Copy link
Member

@darrow-olykos Just wait, I'm working on other chapters right now but will be working on chapter 16 in the next few months. Thanks!

@darrow-olykos
Copy link
Author

Can do! Good luck and thanks for all the great work ☕️ 😁

@@ -71,8 +71,8 @@ that case, no one would ever be able to get the lock, so we’ve chosen to

After we’ve acquired the lock, we can treat the return value, named `num` in
this case, as a mutable reference to the data inside. The type system ensures
that we acquire a lock before using the value in `m`: `Mutex<i32>` is not an
`i32`, so we *must* acquire the lock to be able to use the `i32` value. We
that we acquire a lock before using the value in `m`: `Mutex<i32>`, because `m`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, to me, the colon after m and before Mutex<i32> means "because", so I'm not sure how adding "because" makes this clearer? What if this was two separate sentences instead, like:

The type system ensures that we acquire a lock before using the value in m. The type of m is Mutex<i32>, not i32, so we must call lock to be able to use the i32 value.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carols10cents Your suggestion appears less ambiguous to me 👍

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carols10cents I was having trouble as well when I was reading this in the book. I think it might be worth it to replace the ':' with something else (The second sentence that you wrote here seems good to me). It didn't even cross my mind that ':' was not the type annotation in Rust itself.

@carols10cents
Copy link
Member

Fixed in ca2056e

@darrow-olykos darrow-olykos deleted the patch-1 branch May 2, 2022 15:49
@darrow-olykos
Copy link
Author

Nice @carols10cents !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants