Skip to content

reference: add trailing commas #31412

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
Feb 5, 2016
Merged
Changes from all 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
10 changes: 5 additions & 5 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ Enumeration constructors can have either named or unnamed fields:
```rust
enum Animal {
Dog (String, f64),
Cat { name: String, weight: f64 }
Cat { name: String, weight: f64 },
}

let mut a: Animal = Animal::Dog("Cocoa".to_string(), 37.2);
Expand Down Expand Up @@ -1237,12 +1237,12 @@ const STRING: &'static str = "bitstring";

struct BitsNStrings<'a> {
mybits: [u32; 2],
mystring: &'a str
mystring: &'a str,
}

const BITS_N_STRINGS: BitsNStrings<'static> = BitsNStrings {
mybits: BITS,
mystring: STRING
mystring: STRING,
};
```

Expand Down Expand Up @@ -1661,7 +1661,7 @@ struct Foo;

// Declare a public struct with a private field
pub struct Bar {
field: i32
field: i32,
}

// Declare a public enum with two public variants
Expand Down Expand Up @@ -3212,7 +3212,7 @@ may refer to the variables bound within the pattern they follow.
let message = match maybe_digit {
Some(x) if x < 10 => process_digit(x),
Some(x) => process_other(x),
None => panic!()
None => panic!(),
};
```

Expand Down