Skip to content

Commit e87894e

Browse files
author
Alfie John
committed
doc: adding example for type definitions
1 parent dd5ce5a commit e87894e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/doc/reference.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,12 @@ specific type; the type-specified aspects of a value include:
12741274
For example, the type `(u8, u8)` defines the set of immutable values that are
12751275
composite pairs, each containing two unsigned 8-bit integers accessed by
12761276
pattern-matching and laid out in memory with the `x` component preceding the
1277-
`y` component.
1277+
`y` component:
1278+
1279+
```
1280+
type Point = (u8, u8);
1281+
let p: Point = (41, 68);
1282+
```
12781283

12791284
### Structures
12801285

0 commit comments

Comments
 (0)