Skip to content

Commit

Permalink
[Gardening] UPDATE - use let chain to unwrap snippet and evaluate flag
Browse files Browse the repository at this point in the history
  • Loading branch information
JhonnyBillM committed Sep 5, 2022
1 parent dd5850b commit 46ba27d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions compiler/rustc_typeck/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,9 @@ impl<'a> SessionDiagnostic<'a> for MissingTypeParams {
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
Expand Down

0 comments on commit 46ba27d

Please sign in to comment.