X-Git-Url: https://git.ralfj.de/rust-101.git/blobdiff_plain/b60c82e9d3b03aa36484c1ff68f34f4e78862d46..7922ebded5b33bbc939fd8f9a656261ba7000897:/workspace/src/part05.rs?ds=inline 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. //