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

note about ref patterns in pointer guide #16828

Merged
merged 1 commit into from Aug 31, 2014

Conversation

steveklabnik
Copy link
Member

Fixes #13602

# Patterns and `ref`

When you're trying to `match` something that's stored in a pointer, you may
come across an error. Here's some code:
Copy link
Contributor

Choose a reason for hiding this comment

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

This initially came across as you were going to show an invalid case before the correct one, so it's kinda confusing as the user has no idea which error you're talking about.

Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a simple edit along the lines of "When you're trying to match something that's stored in a pointer, there may be a situation where using y directly isn't the best option available. Here's some code:" will do?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's the "here's some code" that isn't doing it. Perhaps something like, `Let's see how we can approach it better" or something like that so they know they're looking at the correct version, not the faulty one.

I like the rest of @MatejLach's suggestion, though.

@steveklabnik
Copy link
Member Author

Thanks everyone! Took those suggestions into account. What do you think now?

@thehydroimpulse
Copy link
Contributor

Much better :)

@MatejLach
Copy link
Contributor

@thehydroimpulse +1

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Aug 31, 2014
@bors bors merged commit 7e4a145 into rust-lang:master Aug 31, 2014
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.

Pointer tutorial should talk of all things pointer-y
5 participants