Skip to content

Commit 090c015

Browse files
authored
Merge pull request #668 from hawkinsw/oxford_commas
Fix #664: Review Oxford comma usage.
2 parents abe11b6 + af1cf6d commit 090c015

19 files changed

+32
-31
lines changed

src/attributes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
> &nbsp;&nbsp; | `=` [_LiteralExpression_]<sub>_without suffix_</sub>
1717
1818
An _attribute_ is a general, free-form metadatum that is interpreted according
19-
to name, convention, and language and compiler version. Attributes are modeled
19+
to name, convention, language, and compiler version. Attributes are modeled
2020
on Attributes in [ECMA-335], with the syntax coming from [ECMA-334] \(C#).
2121

2222
_Inner attributes_, written with a bang (`!`) after the hash (`#`), apply to the

src/conditional-compilation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*Conditionally compiled source code* is source code that may or may not be
2626
considered a part of the source code depending on certain conditions. <!-- This
2727
definition is sort of vacuous --> Source code can be conditionally compiled
28-
using [attributes], [`cfg`] and [`cfg_attr`], and the built-in [`cfg` macro].
28+
using the [attributes] [`cfg`] and [`cfg_attr`] and the built-in [`cfg` macro].
2929
These conditions are based on the target architecture of the compiled crate,
3030
arbitrary values passed to the compiler, and a few other miscellaneous things
3131
further described below in detail.

src/const_eval.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ to be run.
3737
* Index expressions, [array indexing] or [slice] with a `usize`.
3838
* [Range expressions].
3939
* [Closure expressions] which don't capture variables from the environment.
40-
* Built in [negation], [arithmetic, logical], [comparison] or [lazy boolean]
41-
operators used on integer and floating point types, `bool` and `char`.
40+
* Built-in [negation], [arithmetic], [logical], [comparison] or [lazy boolean]
41+
operators used on integer and floating point types, `bool`, and `char`.
4242
* Shared [borrow]s, except if applied to a type with [interior mutability].
4343
* The [dereference operator].
4444
* [Grouped] expressions.
@@ -57,7 +57,7 @@ A _const context_ is one of the following:
5757
* [statics]
5858
* [enum discriminants]
5959

60-
[arithmetic, logical]: expressions/operator-expr.md#arithmetic-and-logical-binary-operators
60+
[arithmetic]: expressions/operator-expr.md#arithmetic-and-logical-binary-operators
6161
[array expressions]: expressions/array-expr.md
6262
[array indexing]: expressions/array-expr.md#array-and-slice-indexing-expressions
6363
[array indexing]: expressions/array-expr.md#array-and-slice-indexing-expressions
@@ -84,6 +84,7 @@ A _const context_ is one of the following:
8484
[lazy boolean]: expressions/operator-expr.md#lazy-boolean-operators
8585
[let statements]: statements.md#let-statements
8686
[literals]: expressions/literal-expr.md
87+
[logical]: expressions/operator-expr.md#arithmetic-and-logical-binary-operators
8788
[negation]: expressions/operator-expr.md#negation-operators
8889
[overflow]: expressions/operator-expr.md#overflow
8990
[paths]: expressions/path-expr.md

src/crates-and-source-files.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ crate in binary form: either an executable or some sort of
2929
library.[^cratesourcefile]
3030

3131
A _crate_ is a unit of compilation and linking, as well as versioning,
32-
distribution and runtime loading. A crate contains a _tree_ of nested
32+
distribution, and runtime loading. A crate contains a _tree_ of nested
3333
[module] scopes. The top level of this tree is a module that is
3434
anonymous (from the point of view of paths within the module) and any item
3535
within a crate has a canonical [module path] denoting its location

src/dynamically-sized-types.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ types">DSTs</abbr>. Such types can only be used in certain cases:
2020
last field, this makes the struct itself a
2121
<abbr title="dynamically sized type">DST</abbr>.
2222

23-
Notably: [variables], function parameters, [const] and [static] items must be
23+
> **Note**: [variables], function parameters, [const] items, and [static] items must be
2424
`Sized`.
2525

2626
[sized]: special-types-and-traits.md#sized

src/expressions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ a few specific cases:
265265

266266
* Before an expression used as a [statement].
267267
* Elements of [array expressions], [tuple expressions], [call expressions],
268-
tuple-style [struct] and [enum variant] expressions.
268+
and tuple-style [struct] and [enum variant] expressions.
269269
<!--
270270
These were likely stabilized inadvertently.
271271
See https://github.com/rust-lang/rust/issues/32796 and

src/expressions/block-expr.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ expression in the following situations:
180180
* Loop bodies ([`loop`], [`while`], [`while let`], and [`for`]).
181181
* Block expressions used as a [statement].
182182
* Block expressions as elements of [array expressions], [tuple expressions],
183-
[call expressions], tuple-style [struct] and [enum variant] expressions.
183+
[call expressions], and tuple-style [struct] and [enum variant] expressions.
184184
* A block expression as the tail expression of another block expression.
185185
<!-- Keep list in sync with expressions.md -->
186186

src/expressions/loop-expr.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ is equivalent to
181181
}
182182
```
183183

184-
`IntoIterator`, `Iterator` and `Option` are always the standard library items
184+
`IntoIterator`, `Iterator`, and `Option` are always the standard library items
185185
here, not whatever those names resolve to in the current scope. The variable
186-
names `next`, `iter` and `val` are for exposition only, they do not actually
186+
names `next`, `iter`, and `val` are for exposition only, they do not actually
187187
have names the user can type.
188188

189189
> **Note**: that the outer `match` is used to ensure that any

src/introduction.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ provides three kinds of material:
55

66
- Chapters that informally describe each language construct and their use.
77
- Chapters that informally describe the memory model, concurrency model,
8-
runtime services, linkage model and debugging facilities.
8+
runtime services, linkage model, and debugging facilities.
99
- Appendix chapters providing rationale and references to languages that
1010
influenced the design.
1111

src/items/associated-items.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Shorthand | Equivalent
133133
`&'lifetime self` | `self: &'lifetime Self`
134134
`&'lifetime mut self` | `self: &'lifetime mut Self`
135135

136-
> Note: Lifetimes can be and usually are elided with this shorthand.
136+
> **Note**: Lifetimes can be, and usually are, elided with this shorthand.
137137
138138
If the `self` parameter is prefixed with `mut`, it becomes a mutable variable,
139139
similar to regular parameters using a `mut` [identifier pattern]. For example:

src/items/functions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ Exhaustive list of permitted structures in const functions:
210210
* lifetimes
211211
* `Sized` or [`?Sized`]
212212

213-
This means that `<T: 'a + ?Sized>`, `<T: 'b + Sized>` and `<T>`
213+
This means that `<T: 'a + ?Sized>`, `<T: 'b + Sized>`, and `<T>`
214214
are all permitted.
215215

216216
This rule also applies to type parameters of impl blocks that

src/items/generics.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
> _TypeParam_ :\
2121
> &nbsp;&nbsp; [_OuterAttribute_]<sup>?</sup> [IDENTIFIER] ( `:` [_TypeParamBounds_]<sup>?</sup> )<sup>?</sup> ( `=` [_Type_] )<sup>?</sup>
2222
23-
Functions, type aliases, structs, enumerations, unions, traits and
23+
Functions, type aliases, structs, enumerations, unions, traits, and
2424
implementations may be *parameterized* by types and lifetimes. These parameters
2525
are listed in angle <span class="parenthetical">brackets (`<...>`)</span>,
2626
usually immediately after the name of the item and before its definition. For
@@ -34,7 +34,7 @@ trait A<U> {}
3434
struct Ref<'a, T> where T: 'a { r: &'a T }
3535
```
3636

37-
[References], [raw pointers], [arrays], [slices][arrays], [tuples] and
37+
[References], [raw pointers], [arrays], [slices][arrays], [tuples], and
3838
[function pointers] have lifetime or type parameters as well, but are not
3939
referred to with path syntax.
4040

@@ -64,7 +64,7 @@ parameters.
6464
Bounds that don't use the item's parameters or higher-ranked lifetimes are
6565
checked when the item is defined. It is an error for such a bound to be false.
6666

67-
[`Copy`], [`Clone`] and [`Sized`] bounds are also checked for certain generic
67+
[`Copy`], [`Clone`], and [`Sized`] bounds are also checked for certain generic
6868
types when defining the item. It is an error to have `Copy` or `Clone`as a
6969
bound on a mutable reference, [trait object] or [slice][arrays] or `Sized` as a
7070
bound on a trait object or slice.

src/items/unions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ fn test() {
151151
}
152152
```
153153

154-
As you could see, in many aspects (except for layouts, safety and ownership)
154+
As you could see, in many aspects (except for layouts, safety, and ownership)
155155
unions behave exactly like structs, largely as a consequence of inheriting
156156
their syntactic shape from structs. This is also true for many unmentioned
157157
aspects of Rust language (such as privacy, name resolution, type inference,

src/lifetime-elision.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ compiler can infer a sensible default choice.
66
## Lifetime elision in functions
77

88
In order to make common patterns more ergonomic, lifetime arguments can be
9-
*elided* in [function item], [function pointer] and [closure trait] signatures.
9+
*elided* in [function item], [function pointer], and [closure trait] signatures.
1010
The following rules are used to infer lifetime parameters for elided lifetimes.
1111
It is an error to elide lifetime parameters that cannot be inferred. The
1212
placeholder lifetime, `'_`, can also be used to have a lifetime inferred in the

src/memory-allocation-and-lifetime.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Memory allocation and lifetime
22

3-
The _items_ of a program are those functions, modules and types that have their
3+
The _items_ of a program are those functions, modules, and types that have their
44
value calculated at compile-time and stored uniquely in the memory image of the
55
rust process. Items are neither dynamically allocated nor freed.
66

src/special-types-and-traits.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ mutability aren't placed in memory marked as read only.
3838
## `PhantomData<T>`
3939

4040
[`std::marker::PhantomData<T>`] is a zero-sized, minimum alignment, type that
41-
is considered to own a `T` for the purposes of [variance], [drop check] and
41+
is considered to own a `T` for the purposes of [variance], [drop check], and
4242
[auto traits](#auto-traits).
4343

4444
## Operator Traits
4545

4646
The traits in [`std::ops`] and [`std::cmp`] are used to overload [operators],
47-
[indexing expressions] and [call expressions].
47+
[indexing expressions], and [call expressions].
4848

4949
## `Deref` and `DerefMut`
5050

@@ -64,7 +64,7 @@ whose type implements `Copy` are copied rather than moved upon assignment.
6464
fields that are not `Copy`. `Copy` is implemented by the compiler for
6565

6666
* [Numeric types]
67-
* `char`, `bool` and [`!`]
67+
* `char`, `bool`, and [`!`]
6868
* [Tuples] of `Copy` types
6969
* [Arrays] of `Copy` types
7070
* [Shared references]
@@ -94,17 +94,17 @@ immutable [`static` items].
9494

9595
## Auto traits
9696

97-
The [`Send`], [`Sync`], [`UnwindSafe`] and [`RefUnwindSafe`] traits are _auto
97+
The [`Send`], [`Sync`], [`UnwindSafe`], and [`RefUnwindSafe`] traits are _auto
9898
traits_. Auto traits have special properties.
9999

100100
If no explicit implementation or negative implementation is written out for an
101101
auto trait for a given type, then the compiler implements it automatically
102102
according to the following rules:
103103

104-
* `&T`, `&mut T`, `*const T`, `*mut T`, `[T; n]` and `[T]` implement the trait
104+
* `&T`, `&mut T`, `*const T`, `*mut T`, `[T; n]`, and `[T]` implement the trait
105105
if `T` does.
106106
* Function item types and function pointers automatically implement the trait.
107-
* Structs, enums, unions and tuples implement the trait if all of their fields
107+
* Structs, enums, unions, and tuples implement the trait if all of their fields
108108
do.
109109
* Closures implement the trait if the types of all of their captures do. A
110110
closure that captures a `T` by shared reference and a `U` by value implements

src/subtyping.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Variance of types is automatically determined as follows
6565
| `std::marker::PhantomData<T>` | | covariant |
6666
| `Trait<T> + 'a` | covariant | invariant |
6767

68-
The variance of other `struct`, `enum`, `union` and tuple types is decided by
68+
The variance of other `struct`, `enum`, `union`, and tuple types is decided by
6969
looking at the variance of the types of their fields. If the parameter is used
7070
in positions with different variances then the parameter is invariant. For
7171
example the following struct is covariant in `'a` and `T` and invariant in `'b`

src/tokens.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ An _integer literal_ has one of four forms:
361361
mixture of *decimal digits* and _underscores_.
362362
* A _tuple index_ is either `0`, or starts with a *non-zero decimal digit* and
363363
continues with zero or more decimal digits. Tuple indexes are used to refer
364-
to the fields of [tuples], [tuple structs] and [tuple variants].
364+
to the fields of [tuples], [tuple structs], and [tuple variants].
365365
* A _hex literal_ starts with the character sequence `U+0030` `U+0078`
366366
(`0x`) and continues as any mixture (with at least one digit) of hex digits
367367
and underscores.
@@ -429,7 +429,7 @@ Examples of invalid integer literals:
429429
128_i8;
430430
256_u8;
431431
432-
// bin, hex and octal literals must have at least one digit
432+
// bin, hex, and octal literals must have at least one digit
433433
434434
0b_;
435435
0b____;

src/types.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{#include types-redirect.html}}
22
# Types
33

4-
Every variable, item and value in a Rust program has a type. The _type_ of a
4+
Every variable, item, and value in a Rust program has a type. The _type_ of a
55
*value* defines the interpretation of the memory holding it and the operations
66
that may be performed on the value.
77

@@ -94,7 +94,7 @@ type T<'a> = &'a (dyn Any + Send);
9494

9595
## Recursive types
9696

97-
Nominal types &mdash; [structs], [enumerations] and [unions] &mdash; may be
97+
Nominal types &mdash; [structs], [enumerations], and [unions] &mdash; may be
9898
recursive. That is, each `enum` variant or `struct` or `union` field may
9999
refer, directly or indirectly, to the enclosing `enum` or `struct` type
100100
itself. Such recursion has restrictions:

0 commit comments

Comments
 (0)