Skip to content

Commit a2f22a0

Browse files
committed
reference: add trailing commas
1 parent b8b18aa commit a2f22a0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/doc/reference.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ Enumeration constructors can have either named or unnamed fields:
11791179
```rust
11801180
enum Animal {
11811181
Dog (String, f64),
1182-
Cat { name: String, weight: f64 }
1182+
Cat { name: String, weight: f64 },
11831183
}
11841184

11851185
let mut a: Animal = Animal::Dog("Cocoa".to_string(), 37.2);
@@ -1237,12 +1237,12 @@ const STRING: &'static str = "bitstring";
12371237
12381238
struct BitsNStrings<'a> {
12391239
mybits: [u32; 2],
1240-
mystring: &'a str
1240+
mystring: &'a str,
12411241
}
12421242
12431243
const BITS_N_STRINGS: BitsNStrings<'static> = BitsNStrings {
12441244
mybits: BITS,
1245-
mystring: STRING
1245+
mystring: STRING,
12461246
};
12471247
```
12481248

@@ -1661,7 +1661,7 @@ struct Foo;
16611661
16621662
// Declare a public struct with a private field
16631663
pub struct Bar {
1664-
field: i32
1664+
field: i32,
16651665
}
16661666
16671667
// Declare a public enum with two public variants
@@ -3212,7 +3212,7 @@ may refer to the variables bound within the pattern they follow.
32123212
let message = match maybe_digit {
32133213
Some(x) if x < 10 => process_digit(x),
32143214
Some(x) => process_other(x),
3215-
None => panic!()
3215+
None => panic!(),
32163216
};
32173217
```
32183218

0 commit comments

Comments
 (0)