1
Fork 0

don't clone types that are Copy (clippy::clone_on_copy)

This commit is contained in:
Matthias Krüger 2021-09-11 10:18:56 +02:00
parent 22719efcc5
commit c1e96085d3
15 changed files with 30 additions and 34 deletions

View file

@ -448,7 +448,7 @@ impl<'a> SessionDiagnosticDeriveBuilder<'a> {
span_idx = Some(syn::Index::from(idx));
} else {
throw_span_err!(
info.span.clone().unwrap(),
info.span.unwrap(),
"type of field annotated with `#[suggestion(...)]` contains more than one Span"
);
}
@ -460,7 +460,7 @@ impl<'a> SessionDiagnosticDeriveBuilder<'a> {
applicability_idx = Some(syn::Index::from(idx));
} else {
throw_span_err!(
info.span.clone().unwrap(),
info.span.unwrap(),
"type of field annotated with `#[suggestion(...)]` contains more than one Applicability"
);
}
@ -479,7 +479,7 @@ impl<'a> SessionDiagnosticDeriveBuilder<'a> {
return Ok((span, applicability));
}
throw_span_err!(
info.span.clone().unwrap(),
info.span.unwrap(),
"wrong types for suggestion",
|diag| {
diag.help("#[suggestion(...)] on a tuple field must be applied to fields of type (Span, Applicability)")
@ -487,7 +487,7 @@ impl<'a> SessionDiagnosticDeriveBuilder<'a> {
);
}
_ => throw_span_err!(
info.span.clone().unwrap(),
info.span.unwrap(),
"wrong field type for suggestion",
|diag| {
diag.help("#[suggestion(...)] should be applied to fields of type Span or (Span, Applicability)")