diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2015-10-19 17:14:08 -0400 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2015-10-19 17:14:08 -0400 |
| commit | ea3bf79baced33bd21d876261e01bed968f8eca1 (patch) | |
| tree | bdc41d936051cd5ccfad7c526daddc427a2e50d2 /src/doc | |
| parent | d89c2ada16831b4be6665f483d5bf00748d9be63 (diff) | |
| parent | f9d056f1b7866df2822498a55650f70280aa6f76 (diff) | |
| download | rust-ea3bf79baced33bd21d876261e01bed968f8eca1.tar.gz rust-ea3bf79baced33bd21d876261e01bed968f8eca1.zip | |
Rollup merge of #29168 - aarzee:master, r=steveklabnik
Remove leading newlines; replace lines containing only whitespace with empty lines; replace multiple trailing newlines with a single newline; remove trailing whitespace in lines. This PR was created semiautomatically.
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/trpl/documentation.md | 2 | ||||
| -rw-r--r-- | src/doc/trpl/method-syntax.md | 2 | ||||
| -rw-r--r-- | src/doc/trpl/mutability.md | 2 | ||||
| -rw-r--r-- | src/doc/trpl/ownership.md | 6 | ||||
| -rw-r--r-- | src/doc/trpl/references-and-borrowing.md | 6 | ||||
| -rw-r--r-- | src/doc/trpl/strings.md | 4 |
6 files changed, 11 insertions, 11 deletions
diff --git a/src/doc/trpl/documentation.md b/src/doc/trpl/documentation.md index 8cb58ecf2c7..ac4b51333a3 100644 --- a/src/doc/trpl/documentation.md +++ b/src/doc/trpl/documentation.md @@ -73,7 +73,7 @@ hello.rs:4 } ``` This [unfortunate error](https://github.com/rust-lang/rust/issues/22547) is -correct: documentation comments apply to the thing after them, and there's +correct: documentation comments apply to the thing after them, and there's nothing after that last comment. [rc-new]: https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.new diff --git a/src/doc/trpl/method-syntax.md b/src/doc/trpl/method-syntax.md index a2bdd66b0c2..d31d8232470 100644 --- a/src/doc/trpl/method-syntax.md +++ b/src/doc/trpl/method-syntax.md @@ -55,7 +55,7 @@ kinds of things `foo` could be: `self` if it’s just a value on the stack, `&self` if it’s a reference, and `&mut self` if it’s a mutable reference. Because we took the `&self` parameter to `area`, we can use it just like any other parameter. Because we know it’s a `Circle`, we can access the `radius` -just like we would with any other `struct`. +just like we would with any other `struct`. We should default to using `&self`, as you should prefer borrowing over taking ownership, as well as taking immutable references over mutable ones. Here’s an diff --git a/src/doc/trpl/mutability.md b/src/doc/trpl/mutability.md index 2c4316e651a..71acb551e6e 100644 --- a/src/doc/trpl/mutability.md +++ b/src/doc/trpl/mutability.md @@ -84,7 +84,7 @@ philosophy, memory safety, and the mechanism by which Rust guarantees it, the > You may have one or the other of these two kinds of borrows, but not both at > the same time: -> +> > * one or more references (`&T`) to a resource, > * exactly one mutable reference (`&mut T`). diff --git a/src/doc/trpl/ownership.md b/src/doc/trpl/ownership.md index 89116f77b41..d8ef44b782a 100644 --- a/src/doc/trpl/ownership.md +++ b/src/doc/trpl/ownership.md @@ -42,7 +42,7 @@ With that in mind, let’s learn about ownership. # Ownership [Variable bindings][bindings] have a property in Rust: they ‘have ownership’ -of what they’re bound to. This means that when a binding goes out of scope, +of what they’re bound to. This means that when a binding goes out of scope, Rust will free the bound resources. For example: ```rust @@ -158,8 +158,8 @@ has no pointers to data somewhere else, copying it is a full copy. All primitive types implement the `Copy` trait and their ownership is therefore not moved like one would assume, following the ´ownership rules´. -To give an example, the two following snippets of code only compile because the -`i32` and `bool` types implement the `Copy` trait. +To give an example, the two following snippets of code only compile because the +`i32` and `bool` types implement the `Copy` trait. ```rust fn main() { diff --git a/src/doc/trpl/references-and-borrowing.md b/src/doc/trpl/references-and-borrowing.md index 3027f10aca5..13cfecdf1a7 100644 --- a/src/doc/trpl/references-and-borrowing.md +++ b/src/doc/trpl/references-and-borrowing.md @@ -233,7 +233,7 @@ So when we add the curly braces: ```rust let mut x = 5; -{ +{ let y = &mut x; // -+ &mut borrow starts here *y += 1; // | } // -+ ... and ends here @@ -306,7 +306,7 @@ which was invalid. For example: ```rust,ignore let y: &i32; -{ +{ let x = 5; y = &x; } @@ -323,7 +323,7 @@ error: `x` does not live long enough note: reference must be valid for the block suffix following statement 0 at 2:16... let y: &i32; -{ +{ let x = 5; y = &x; } diff --git a/src/doc/trpl/strings.md b/src/doc/trpl/strings.md index aa1944a0993..18483664989 100644 --- a/src/doc/trpl/strings.md +++ b/src/doc/trpl/strings.md @@ -102,8 +102,8 @@ println!(""); This prints: ```text -229, 191, 160, 231, 138, 172, 227, 131, 143, 227, 131, 129, 229, 133, 172, -忠, 犬, ハ, チ, 公, +229, 191, 160, 231, 138, 172, 227, 131, 143, 227, 131, 129, 229, 133, 172, +忠, 犬, ハ, チ, 公, ``` As you can see, there are more bytes than `char`s. |
