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

ch18-03: ref and mut ref should be more prominent #1102

Closed
chenl opened this issue Jan 8, 2018 · 2 comments
Closed

ch18-03: ref and mut ref should be more prominent #1102

chenl opened this issue Jan 8, 2018 · 2 comments
Milestone

Comments

@chenl
Copy link
Contributor

chenl commented Jan 8, 2018

While it is important to list all the ways a pattern can be destructured, this become a not very interesting laundry list. However, somewhere in the middle of it you discuss ref and ref mut.

According to my experience ref and ref mut are a major source of confusion for new rustations, at least it was for me. And the explanation here gave me an A-HA moment: Of course ref and ref mut are fore destructuring...!

I am just afraid that this important insight might be lost among what can be considered a list of syntactic sugar items.

Consider breaking this very long section into two, moving the ref and ref mut to some prominent place in one of them, or alternatively have some text that will make the reader stop and pay extra attention here.

@carols10cents
Copy link
Member

I agree that ref and ref mut are confusing, but hopefully they should become much rarer soon-- the first implementation of the Match Ergonomics Using Default Binding Modes RFC is available in nightly, check it out!

Given that it's a rough edge in Rust that should get smoothed out soon, do you still think we should emphasize it more?

@carols10cents
Copy link
Member

My inclination is that we shouldn't emphasize ref and ref mut more, because they should become rarer soon-- so I'm closing this issue. Thanks!

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

No branches or pull requests

2 participants