X-Git-Url: https://git.ralfj.de/rust-101.git/blobdiff_plain/8fcdbed310c53f621fba0401399659ed1a1ec446..67c07b22fc19f6e39b41bdd5c95b02643f51e81b:/workspace/src/part07.rs?ds=inline diff --git a/workspace/src/part07.rs b/workspace/src/part07.rs index e2796b4..75bd0cc 100644 --- a/workspace/src/part07.rs +++ b/workspace/src/part07.rs @@ -11,7 +11,10 @@ pub trait Minimum { pub fn vec_min(v: &Vec) -> Option<&T> { let mut min: Option<&T> = None; for e in v { - unimplemented!() + min = Some(match min { + None => e, + Some(n) => n.min(e) + }); } min }