]> git.lizzy.rs Git - rust.git/commitdiff
std::cmp::max -> max
authorMike Anderson <hello@mrmikea.com>
Wed, 6 Jan 2016 06:42:19 +0000 (00:42 -0600)
committerMike Anderson <hello@mrmikea.com>
Wed, 6 Jan 2016 06:42:19 +0000 (00:42 -0600)
src/librustc_driver/lib.rs

index 99d30f3bcfb9937667063ac33e5152ecf70adf24..7b8970876f6e3adc7711e9211920ae81971df266 100644 (file)
@@ -628,12 +628,12 @@ fn sort_lint_groups(lints: Vec<(&'static str, Vec<lint::LintId>, bool)>)
 
 
 
-    let max_name_len = plugin_groups.iter()
-                                    .chain(&builtin_groups)
-                                    .map(|&(s, _)| s.chars().count())
-                                    .max()
-                                    .unwrap_or(0);
-    let max_name_len = std::cmp::max(max_name_len, "warnings".len());
+    let max_name_len = max("warnings".len(),
+                           plugin_groups.iter()
+                                        .chain(&builtin_groups)
+                                        .map(|&(s, _)| s.chars().count())
+                                        .max()
+                                        .unwrap_or(0));
 
     let padded = |x: &str| {
         let mut s = repeat(" ")