]> git.lizzy.rs Git - rust.git/commitdiff
Simplify report_elision_failure a little bit.
authorNick Hamann <nick@wabbo.org>
Wed, 18 May 2016 18:09:25 +0000 (13:09 -0500)
committerNick Hamann <nick@wabbo.org>
Wed, 18 May 2016 18:09:25 +0000 (13:09 -0500)
src/librustc_typeck/astconv.rs

index c3633625436ad450d1b3f6c2df286ea8556a811a..8fc6b552e146261bee9ffd03021fa7a970d9bf19 100644 (file)
@@ -222,12 +222,6 @@ fn report_elision_failure(
 
     let elided_len = elided_params.len();
 
-    let any_lifetimes = if elided_len > 0 {
-        true
-    } else {
-        false
-    };
-
     for (i, info) in elided_params.into_iter().enumerate() {
         let ElisionFailureInfo {
             name, lifetime_count: n, have_bound_regions
@@ -262,7 +256,7 @@ fn report_elision_failure(
                     there is no value for it to be borrowed from");
         help!(db,
                    "consider giving it a 'static lifetime");
-    } else if !any_lifetimes {
+    } else if elided_len == 0 {
         help!(db,
                    "this function's return type contains a borrowed value with \
                     an elided lifetime, but the lifetime cannot be derived from \