File tree 1 file changed +3
-1
lines changed
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -2553,7 +2553,7 @@ comma:
2553
2553
2554
2554
There are several forms of struct expressions. A _ struct expression_
2555
2555
consists of the [ path] ( #paths ) of a [ struct item] ( #structs ) , followed by
2556
- a brace-enclosed list of one or more comma-separated name-value pairs,
2556
+ a brace-enclosed list of zero or more comma-separated name-value pairs,
2557
2557
providing the field values of a new instance of the struct. A field name
2558
2558
can be any identifier, and is separated from its value expression by a colon.
2559
2559
The location denoted by a struct field is mutable if and only if the
@@ -2572,10 +2572,12 @@ The following are examples of struct expressions:
2572
2572
2573
2573
```
2574
2574
# struct Point { x: f64, y: f64 }
2575
+ # struct NothingInMe { }
2575
2576
# struct TuplePoint(f64, f64);
2576
2577
# mod game { pub struct User<'a> { pub name: &'a str, pub age: u32, pub score: usize } }
2577
2578
# struct Cookie; fn some_fn<T>(t: T) {}
2578
2579
Point {x: 10.0, y: 20.0};
2580
+ NothingInMe {};
2579
2581
TuplePoint(10.0, 20.0);
2580
2582
let u = game::User {name: "Joe", age: 35, score: 100_000};
2581
2583
some_fn::<Cookie>(Cookie);
You can’t perform that action at this time.
0 commit comments