[Gardening] UPDATE - use let chain to unwrap snippet and evaluate flag
This commit is contained in:
parent
dd5850b8fa
commit
46ba27d5b5
@ -270,12 +270,9 @@ impl<'a> SessionDiagnostic<'a> for MissingTypeParams {
|
|||||||
err.span_label(self.def_span, rustc_errors::fluent::typeck::label);
|
err.span_label(self.def_span, rustc_errors::fluent::typeck::label);
|
||||||
|
|
||||||
let mut suggested = false;
|
let mut suggested = false;
|
||||||
if let (Some(snippet), true) = (
|
// Don't suggest setting the type params if there are some already: the order is
|
||||||
self.span_snippet,
|
// tricky to get right and the user will already know what the syntax is.
|
||||||
// Don't suggest setting the type params if there are some already: the order is
|
if let Some(snippet) = self.span_snippet && self.empty_generic_args {
|
||||||
// tricky to get right and the user will already know what the syntax is.
|
|
||||||
self.empty_generic_args,
|
|
||||||
) {
|
|
||||||
if snippet.ends_with('>') {
|
if snippet.ends_with('>') {
|
||||||
// The user wrote `Trait<'a, T>` or similar. To provide an accurate suggestion
|
// 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
|
// we would have to preserve the right order. For now, as clearly the user is
|
||||||
|
Loading…
x
Reference in New Issue
Block a user