pub fn vec_min<T: Minimum>(v: &Vec<T>) -> 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
}
}
-// Now we can compare `BigInt`s. Rust treats `PratialEq` special in that it is wired to the operator `==`:
+// Now we can compare `BigInt`s. Rust treats `PartialEq` special in that it is wired to the operator `==`:
fn compare_big_ints() {
let b1 = BigInt::new(13);
let b2 = BigInt::new(37);
// ## Formatting
-// All formating is handled by [`std::fmt`](http://doc.rust-lang.org/std/fmt/index.html). I won't explain
+// All formating is handled by [`std::fmt`](https://doc.rust-lang.org/std/fmt/index.html). I won't explain
// all the details, and refer you to the documentation instead.
use std::fmt;