Merge pull request #148 from Zajn/zajn/fix-typos

Fix typos/grammar and markdown link syntax
This commit is contained in:
Carol Nichols 2016-07-28 15:55:12 -04:00 committed by GitHub
commit 9e1cb945de

View File

@ -206,7 +206,7 @@ it only works for memory. What if, instead of a `String`, we had a
`TcpConnection`? Opening and closing a network connection is very similar to
allocating and freeing memory. The solution that we could use there is to allow
the programmer to hook into the assignment, similar to `drop()`, and write code
fix things up. That would work, but now, an `=` can run arbitrary code. Thats
to fix things up. That would work, but now, an `=` can run arbitrary code. Thats
also not good, and it doesnt solve our efficiency concerns either.
Lets take a step back: the root of the problem is that `s1` and `s2` both
@ -258,7 +258,7 @@ inexpensive.
But what if we _do_ want to deeply copy the `String`s data, and not just the
`String` itself? Theres a common method for that: `clone()`. We will discuss
methods in the next section on [`struct`]s, but theyre a common enough feature
methods in the next section on [structs], but theyre a common enough feature
in many programming languages that you have probably seen them before.
Heres an example of the `clone()` method in action:
@ -270,7 +270,7 @@ let s2 = s1.clone();
println!("{}", s1);
```
[`struct`]: structs.html
[structs]: ch05-01-structs.html
This will work just fine. Remember our diagram from before? In this case,
it _is_ doing this:
@ -442,7 +442,7 @@ owner goes out of scope, if it hasnt been moved, it will `drop()`.
This might seem a bit tedious, and it is. What if I want to let a function use
a value, but not take ownership? Its quite annoying that anything I pass in
also needs passed back. Look at this function:
also needs to be passed back. Look at this function:
```rust
fn main() {