Skip to content

Commit ec37d45

Browse files
committed
Rollup merge of rust-lang#26787 - tshepang:tuple-usage, r=steveklabnik
2 parents 08395a9 + 72c0275 commit ec37d45

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/doc/reference.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3328,10 +3328,13 @@ An example of a tuple type and its use:
33283328

33293329
```
33303330
type Pair<'a> = (i32, &'a str);
3331-
let p: Pair<'static> = (10, "hello");
3331+
let p: Pair<'static> = (10, "ten");
33323332
let (a, b) = p;
3333-
assert!(b != "world");
3334-
assert!(p.0 == 10);
3333+
3334+
assert_eq!(a, 10);
3335+
assert_eq!(b, "ten");
3336+
assert_eq!(p.0, 10);
3337+
assert_eq!(p.1, "ten");
33353338
```
33363339

33373340
For historical reasons and convenience, the tuple type with no elements (`()`)

0 commit comments

Comments
 (0)