]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_typeck/src/errors.rs
Address code review comments
[rust.git] / compiler / rustc_typeck / src / errors.rs
index d280fa5156bdb350504c88a1951d14b3c847d921..0d2e667458592caf68d1c49212e217ee8be9195d 100644 (file)
@@ -270,12 +270,9 @@ fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGua
         err.span_label(self.def_span, rustc_errors::fluent::typeck::label);
 
         let mut suggested = false;
-        if let (Some(snippet), true) = (
-            self.span_snippet,
-            // Don't suggest setting the type params if there are some already: the order is
-            // tricky to get right and the user will already know what the syntax is.
-            self.empty_generic_args,
-        ) {
+        // Don't suggest setting the type params if there are some already: the order is
+        // tricky to get right and the user will already know what the syntax is.
+        if let Some(snippet) = self.span_snippet && self.empty_generic_args {
             if snippet.ends_with('>') {
                 // The user wrote `Trait<'a, T>` or similar. To provide an accurate suggestion
                 // we would have to preserve the right order. For now, as clearly the user is