Skip to content

Commit 46ba27d

Browse files
committed
[Gardening] UPDATE - use let chain to unwrap snippet and evaluate flag
1 parent dd5850b commit 46ba27d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

compiler/rustc_typeck/src/errors.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,9 @@ impl<'a> SessionDiagnostic<'a> for MissingTypeParams {
270270
err.span_label(self.def_span, rustc_errors::fluent::typeck::label);
271271

272272
let mut suggested = false;
273-
if let (Some(snippet), true) = (
274-
self.span_snippet,
275-
// Don't suggest setting the type params if there are some already: the order is
276-
// tricky to get right and the user will already know what the syntax is.
277-
self.empty_generic_args,
278-
) {
273+
// Don't suggest setting the type params if there are some already: the order is
274+
// tricky to get right and the user will already know what the syntax is.
275+
if let Some(snippet) = self.span_snippet && self.empty_generic_args {
279276
if snippet.ends_with('>') {
280277
// The user wrote `Trait<'a, T>` or similar. To provide an accurate suggestion
281278
// we would have to preserve the right order. For now, as clearly the user is

0 commit comments

Comments
 (0)