Added minmax function.
Tests ok
auto merge of #11789 : pongad/rust/master, r=huonw

All tests passing. #5268