Closed
Description
Currently, we don't define Ord for &mut T
if T
is Ord
. But we should. As a curious side-effect, that permits you to write things like:
fn min<T:Ord>(x: T, y: T) -> T {
if x < y { x } else { y }
}
pub fn main() {
let mut x = 3;
let mut y = 4;
let mut z = 5;
*min(&mut x, &mut y) = min(0, z);
}