diff options
| author | iirelu <anna@bawk.space> | 2018-09-03 21:56:30 +0200 |
|---|---|---|
| committer | iirelu <anna@bawk.space> | 2018-09-03 21:56:30 +0200 |
| commit | 6cbcfa276185d650ca04fb96ddec15f1b82c5806 (patch) | |
| tree | 06f35c8a30e61cabe68913012d750e67504d0113 /src/libstd/keyword_docs.rs | |
| parent | c1bd8a9c615b6ec9124c9525c8d0898c806b62c8 (diff) | |
| download | rust-6cbcfa276185d650ca04fb96ddec15f1b82c5806.tar.gz rust-6cbcfa276185d650ca04fb96ddec15f1b82c5806.zip | |
Fix a few small things, re-word others
Mostly addressing notes on ambiguous syntax and spurious newlines.
Diffstat (limited to 'src/libstd/keyword_docs.rs')
| -rw-r--r-- | src/libstd/keyword_docs.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libstd/keyword_docs.rs b/src/libstd/keyword_docs.rs index 5c3a2b18e1c..a1f594d5244 100644 --- a/src/libstd/keyword_docs.rs +++ b/src/libstd/keyword_docs.rs @@ -53,7 +53,7 @@ mod as_keyword { } /// Constants must be explicitly typed, unlike with `let` you can't ignore its type and let the /// compiler figure it out. Any constant value can be defined in a const, which in practice happens /// to be most things that would be reasonable to have a constant. For example, you can't have a -/// File as a const. +/// File as a `const`. /// /// The only lifetime allowed in a constant is 'static, which is the lifetime that encompasses all /// others in a Rust program. For example, if you wanted to define a constant string, it would look @@ -214,8 +214,9 @@ mod let_keyword { } /// } /// ``` /// -/// Another shortcut for struct instantiation is available when you need to make a new struct that -/// shares most of a previous struct's values called struct update syntax: +/// Another shortcut for struct instantiation is available, used when you need to make a new +/// struct that has the same values as most of a previous struct of the same type, called struct +/// update syntax: /// /// ```rust /// # struct Foo { field1: String, field2: () } @@ -229,10 +230,9 @@ mod let_keyword { } /// Tuple structs are instantiated in the same way as tuples themselves, except with the struct's /// name as a prefix: `Foo(123, false, 0.1)`. /// -/// Empty structs are instantiated with just their name and nothing else. `let thing = +/// Empty structs are instantiated with just their name, and don't need anything else. `let thing = /// EmptyStruct;` /// -/// /// # Style conventions /// /// Structs are always written in CamelCase, with few exceptions. While the trailing comma on a @@ -245,5 +245,4 @@ mod let_keyword { } /// [`PhantomData`]: marker/struct.PhantomData.html /// [book]: https://doc.rust-lang.org/book/second-edition/ch05-01-defining-structs.html /// [reference]: https://doc.rust-lang.org/reference/items/structs.html - mod struct_keyword { } |
