Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e87894e

Browse files
author
Alfie John
committedNov 20, 2014
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

5 commit comments

Comments
 (5)

bors commented on Nov 22, 2014

@bors
Collaborator

bors commented on Nov 22, 2014

@bors
Collaborator

merging alfie/rust/master = e87894e into auto

bors commented on Nov 22, 2014

@bors
Collaborator

alfie/rust/master = e87894e merged ok, testing candidate = ccc4a7c

bors commented on Nov 23, 2014

@bors
Collaborator

fast-forwarding master to auto = ccc4a7c

Please sign in to comment.