From: Alexander Krotov Date: Mon, 12 Sep 2016 00:07:09 +0000 (+0300) Subject: Remove unnecessary "replace" word X-Git-Url: https://git.ralfj.de/rust-101.git/commitdiff_plain/ff51d51af5fe1df973d276c12ba9bdac84d94382?hp=fd7c4d96a0cd1c9882f790a2aad2c3bad1706082 Remove unnecessary "replace" word --- diff --git a/src/part06.rs b/src/part06.rs index 4c0e6ce..7113094 100644 --- a/src/part06.rs +++ b/src/part06.rs @@ -44,7 +44,7 @@ fn vec_min(v: &Vec) -> Option { //@ The answer is already hidden in the type of `vec_min`: `v` is just borrowed, but //@ the Option that it returns is *owned*. We can't just return one of the elements of `v`, //@ as that would mean that it is no longer in the vector! In our code, this comes up when we update -//@ the intermediate variable `min`, which also has type `Option`. If you replace get rid of the +//@ the intermediate variable `min`, which also has type `Option`. If you get rid of the //@ `e.clone()`, Rust will complain "Cannot move out of borrowed content". That's because //@ `e` is a `&BigInt`. Assigning `min = Some(*e)` works just like a function call: Ownership of the //@ underlying data is transferred from `e` to `min`. But that's not allowed, since