X-Git-Url: https://git.ralfj.de/rust-101.git/blobdiff_plain/8fcdbed310c53f621fba0401399659ed1a1ec446..83e8dbfff2a6fdce785af58dbb13f007c4234cf2:/workspace/src/part05.rs diff --git a/workspace/src/part05.rs b/workspace/src/part05.rs index 78113b7..65f6f7d 100644 --- a/workspace/src/part05.rs +++ b/workspace/src/part05.rs @@ -26,8 +26,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. //