]> git.lizzy.rs Git - rust.git/commitdiff
changed a line from an if else to std::cmp::max
authorhman523 <shbarbella@gmail.com>
Tue, 24 Sep 2019 00:51:15 +0000 (19:51 -0500)
committerhman523 <shbarbella@gmail.com>
Tue, 24 Sep 2019 00:51:15 +0000 (19:51 -0500)
src/librustc_errors/emitter.rs

index c13a4b8dbb487ae733a7673875f3eb4906a48a6b..2a89c94652a249205a0decb301a551c1d3f32e36 100644 (file)
@@ -1049,7 +1049,7 @@ fn get_max_line_num(&mut self, span: &MultiSpan, children: &[SubDiagnostic]) ->
 
         for sub in children {
             let sub_result = self.get_multispan_max_line_num(&sub.span);
-            max = if sub_result > max { sub_result } else { max };
+            max = std::cmp::max(sub_result, max);
         }
         max
     }