Skip to content

Mention array sugar in guide #17535

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

Merged
merged 1 commit into from
Sep 29, 2014
Merged

Mention array sugar in guide #17535

merged 1 commit into from
Sep 29, 2014

Conversation

Manishearth
Copy link
Member

It's a rather useful syntax, and non-obvious.

A friend of mine is learning Rust and was trying to find a way to easily do such an initialization — he couldn't find it in the guide and was pretty surprised when I showed him. Looks like something that should be mentioned.

r? @steveklabnik

@@ -1219,7 +1219,7 @@ fn main() {

We can re-write this as a `match`:

```{rust}
```{rust}[
Copy link
Member

Choose a reason for hiding this comment

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

Intentional?

Copy link
Member

Choose a reason for hiding this comment

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

is this right?

@steveklabnik
Copy link
Member

The guide isn't intended to be comprehensive, so there are lots of things that aren't in there. That said, I think this is fine to add. r=me with one nit

@Manishearth
Copy link
Member Author

@steveklabnik fixed

bors added a commit that referenced this pull request Sep 29, 2014
It's a rather useful syntax, and non-obvious.

A friend of mine is learning Rust and was trying to find a way to easily do such an initialization — he couldn't find it in the guide and was pretty surprised when I showed him. Looks like something that should be mentioned.

r? @steveklabnik
@bors bors closed this Sep 29, 2014
@bors bors merged commit 1f4cd80 into rust-lang:master Sep 29, 2014
@Manishearth Manishearth deleted the patch-2 branch January 10, 2015 21:26
lnicola pushed a commit to lnicola/rust that referenced this pull request Jul 11, 2024
fix: Fix up the syntax tree for macro 2.0

Fixes rust-lang/rust-analyzer#10266

This change is trivial now that we don't have a token map anymore
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