X-Git-Url: https://git.ralfj.de/rust-101.git/blobdiff_plain/b60c82e9d3b03aa36484c1ff68f34f4e78862d46..430c62a4f32989f1bf27967f70bbbd49f9d790fa:/src/part05.rs diff --git a/src/part05.rs b/src/part05.rs index b593360..6d2d813 100644 --- a/src/part05.rs +++ b/src/part05.rs @@ -48,8 +48,10 @@ impl BigInt { } // We can convert any vector of digits into a number, by removing trailing zeros. The `mut` - // declaration for `v` here is just like the one in `let mut ...`, it says that we will locally - // change the vector `v`. + // declaration for `v` here is just like the one in `let mut ...`: We completely own `v`, but Rust + // still asks us to make our intention of modifying it explicit. This `mut` is *not* part of the + // type of `from_vec` - the caller has to give up ownership of `v` anyway, so they don't care anymore + // what you do to it. // // **Exercise 05.1**: Implement this function. //