]> git.lizzy.rs Git - rust.git/commit
auto merge of #7414 : gifnksm/rust/max_by, r=catamorphism
authorbors <bors@rust-lang.org>
Thu, 27 Jun 2013 17:37:36 +0000 (10:37 -0700)
committerbors <bors@rust-lang.org>
Thu, 27 Jun 2013 17:37:36 +0000 (10:37 -0700)
commit9b6dfb85782a6ec50c39292626acf2c74b0ae754
treee76a0445582cae4f4e001cfa5f9e77bae38a10ae
parent36527360a66024d0e3f971c0732efc52368afc8b
parent8edb8f6d39498476f1124ce1bb5bb4e094bde43f
auto merge of #7414 : gifnksm/rust/max_by, r=catamorphism

`max_by` method returns the element that gives the maximum value from the specfied function.
`max_by`/`min_by` are convenient when you want to get the value which has greatest/smallest scores.

Inspired by [ruby's Enumerable module](http://ruby-doc.org/core-2.0/Enumerable.html).