X-Git-Url: https://git.ralfj.de/rust-101.git/blobdiff_plain/4f61be32dd480f23a7fef05ee66c42ae27c980c6..a2eeb1b93e8f52b2119fb11d56f5ffc764ac747b:/workspace/src/part06.rs?ds=inline diff --git a/workspace/src/part06.rs b/workspace/src/part06.rs index 8b69022..15b55d2 100644 --- a/workspace/src/part06.rs +++ b/workspace/src/part06.rs @@ -1,5 +1,3 @@ -// ***Remember to enable/add this part in `main.rs`!*** - // Rust-101, Part 06: Copy, Lifetimes // ================================== @@ -24,10 +22,10 @@ impl BigInt { } } -// Now we can write `vec_min`. However, in order to make it type-check, we have to make a full (deep) copy of e -// by calling `clone()`. +// Now we can write `vec_min`. fn vec_min(v: &Vec) -> Option { let mut min: Option = None; + // If `v` is a shared borrowed vector, then the default for iterating over it is to call `iter`, the iterator that borrows the elements. for e in v { unimplemented!() }