diff options
| author | Tshepang Lekhonkhobe <tshepang@gmail.com> | 2015-09-24 08:42:39 +0200 |
|---|---|---|
| committer | Tshepang Lekhonkhobe <tshepang@gmail.com> | 2015-09-24 08:42:39 +0200 |
| commit | 0b13ee0ced39db0acaf1bb966e57417bd42b0423 (patch) | |
| tree | 7cb5fc8bc4a722de1e4d988badd2499299a7aa88 /src/doc/reference.md | |
| parent | 07ca1ab1ec32ac99a61312ec07d66db5f3657040 (diff) | |
| download | rust-0b13ee0ced39db0acaf1bb966e57417bd42b0423.tar.gz rust-0b13ee0ced39db0acaf1bb966e57417bd42b0423.zip | |
reference: rename "structure" to the more familiar "struct"
Diffstat (limited to 'src/doc/reference.md')
| -rw-r--r-- | src/doc/reference.md | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md index 83849574260..336c25744ca 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -674,7 +674,7 @@ There are several kinds of item: * [modules](#modules) * [functions](#functions) * [type definitions](grammar.html#type-definitions) -* [structures](#structures) +* [structs](#structs) * [enumerations](#enumerations) * [constant items](#constant-items) * [static items](#static-items) @@ -1155,7 +1155,7 @@ type Point = (u8, u8); let p: Point = (41, 68); ``` -### Structures +### Structs A _structure_ is a nominal [structure type](#structure-types) defined with the keyword `struct`. @@ -2614,7 +2614,7 @@ comma: ### Structure expressions There are several forms of structure expressions. A _structure expression_ -consists of the [path](#paths) of a [structure item](#structures), followed by +consists of the [path](#paths) of a [structure item](#structs), followed by a brace-enclosed list of one or more comma-separated name-value pairs, providing the field values of a new instance of the structure. A field name can be any identifier, and is separated from its value expression by a colon. @@ -2622,13 +2622,13 @@ The location denoted by a structure field is mutable if and only if the enclosing structure is mutable. A _tuple structure expression_ consists of the [path](#paths) of a [structure -item](#structures), followed by a parenthesized list of one or more +item](#structs), followed by a parenthesized list of one or more comma-separated expressions (in other words, the path of a structure item followed by a tuple expression). The structure item must be a tuple structure item. A _unit-like structure expression_ consists only of the [path](#paths) of a -[structure item](#structures). +[structure item](#structs). The following are examples of structure expressions: @@ -3145,7 +3145,7 @@ if` condition is evaluated. If all `if` and `else if` conditions evaluate to A `match` expression branches on a *pattern*. The exact form of matching that occurs depends on the pattern. Patterns consist of some combination of -literals, destructured arrays or enum constructors, structures and tuples, +literals, destructured arrays or enum constructors, structs and tuples, variable binding specifications, wildcards (`..`), and placeholders (`_`). A `match` expression has a *head expression*, which is the value to compare to the patterns. The type of the patterns must equal the type of the head @@ -3469,7 +3469,7 @@ named reference to an [`enum` item](#enumerations). ### Recursive types Nominal types — [enumerations](#enumerated-types) and -[structures](#structure-types) — may be recursive. That is, each `enum` +[structs](#structure-types) — may be recursive. That is, each `enum` constructor or `struct` field may refer, directly or indirectly, to the enclosing `enum` or `struct` type itself. Such recursion has restrictions: @@ -3497,7 +3497,7 @@ let a: List<i32> = List::Cons(7, Box::new(List::Cons(13, Box::new(List::Nil)))); ### Pointer types All pointers in Rust are explicit first-class values. They can be copied, -stored into data structures, and returned from functions. There are two +stored into data structs, and returned from functions. There are two varieties of pointer in Rust: * References (`&`) |
