mirror of
https://github.com/rust-lang/book.git
synced 2026-11-30 19:54:34 -06:00
Put back code formatting inside links; works with mdbook 0.0.13
This commit is contained in:
@@ -258,7 +258,7 @@ inexpensive.
|
|||||||
|
|
||||||
But what if we _do_ want to deeply copy the `String`’s data, and not just the
|
But what if we _do_ want to deeply copy the `String`’s data, and not just the
|
||||||
`String` itself? There’s a common method for that: `clone()`. We will discuss
|
`String` itself? There’s a common method for that: `clone()`. We will discuss
|
||||||
methods in the next section on [structs], but they’re a common enough feature
|
methods in the next section on [`structs`], but they’re a common enough feature
|
||||||
in many programming languages that you have probably seen them before.
|
in many programming languages that you have probably seen them before.
|
||||||
|
|
||||||
Here’s an example of the `clone()` method in action:
|
Here’s an example of the `clone()` method in action:
|
||||||
@@ -270,7 +270,7 @@ let s2 = s1.clone();
|
|||||||
println!("{}", s1);
|
println!("{}", s1);
|
||||||
```
|
```
|
||||||
|
|
||||||
[structs]: ch05-01-structs.html
|
[`structs`]: ch05-01-structs.html
|
||||||
|
|
||||||
This will work just fine. Remember our diagram from before? In this case,
|
This will work just fine. Remember our diagram from before? In this case,
|
||||||
it _is_ doing this:
|
it _is_ doing this:
|
||||||
|
|||||||
Reference in New Issue
Block a user