projects
/
rust-101.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
fd7c4d9
)
Remove unnecessary "replace" word
author
Alexander Krotov
<ilabdsf@gmail.com>
Mon, 12 Sep 2016 00:07:09 +0000
(
03:07
+0300)
committer
Alexander Krotov
<ilabdsf@gmail.com>
Mon, 12 Sep 2016 00:07:09 +0000
(
03:07
+0300)
src/part06.rs
patch
|
blob
|
history
diff --git
a/src/part06.rs
b/src/part06.rs
index 4c0e6cebaeda3ffdda5f6191749e5a804355a768..7113094f457e3a77d77267ba129ae85bab165a46 100644
(file)
--- a/
src/part06.rs
+++ b/
src/part06.rs
@@
-44,7
+44,7
@@
fn vec_min(v: &Vec<BigInt>) -> Option<BigInt> {
//@ The answer is already hidden in the type of `vec_min`: `v` is just borrowed, but
//@ the Option<BigInt> 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 answer is already hidden in the type of `vec_min`: `v` is just borrowed, but
//@ the Option<BigInt> 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<BigInt>`. If you
replace
get rid of the
+//@ the intermediate variable `min`, which also has type `Option<BigInt>`. 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
//@ `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