Skip to content

Commit 6cbcfa2

Browse files
committed
Fix a few small things, re-word others
Mostly addressing notes on ambiguous syntax and spurious newlines.
1 parent c1bd8a9 commit 6cbcfa2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/libstd/keyword_docs.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ mod as_keyword { }
5353
/// Constants must be explicitly typed, unlike with `let` you can't ignore its type and let the
5454
/// compiler figure it out. Any constant value can be defined in a const, which in practice happens
5555
/// to be most things that would be reasonable to have a constant. For example, you can't have a
56-
/// File as a const.
56+
/// File as a `const`.
5757
///
5858
/// The only lifetime allowed in a constant is 'static, which is the lifetime that encompasses all
5959
/// 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 { }
214214
/// }
215215
/// ```
216216
///
217-
/// Another shortcut for struct instantiation is available when you need to make a new struct that
218-
/// shares most of a previous struct's values called struct update syntax:
217+
/// Another shortcut for struct instantiation is available, used when you need to make a new
218+
/// struct that has the same values as most of a previous struct of the same type, called struct
219+
/// update syntax:
219220
///
220221
/// ```rust
221222
/// # struct Foo { field1: String, field2: () }
@@ -229,10 +230,9 @@ mod let_keyword { }
229230
/// Tuple structs are instantiated in the same way as tuples themselves, except with the struct's
230231
/// name as a prefix: `Foo(123, false, 0.1)`.
231232
///
232-
/// Empty structs are instantiated with just their name and nothing else. `let thing =
233+
/// Empty structs are instantiated with just their name, and don't need anything else. `let thing =
233234
/// EmptyStruct;`
234235
///
235-
///
236236
/// # Style conventions
237237
///
238238
/// Structs are always written in CamelCase, with few exceptions. While the trailing comma on a
@@ -245,5 +245,4 @@ mod let_keyword { }
245245
/// [`PhantomData`]: marker/struct.PhantomData.html
246246
/// [book]: https://doc.rust-lang.org/book/second-edition/ch05-01-defining-structs.html
247247
/// [reference]: https://doc.rust-lang.org/reference/items/structs.html
248-
249248
mod struct_keyword { }

0 commit comments

Comments
 (0)