mirror of
https://github.com/dtolnay/thiserror.git
synced 2025-04-04 13:27:38 +03:00
Eliminate unneeded use of Spanned trait on single tokens
This commit is contained in:
parent
f729af95d1
commit
490dc0102b
1 changed files with 6 additions and 6 deletions
|
@ -528,15 +528,15 @@ fn type_parameter_of_option(ty: &Type) -> Option<&Type> {
|
|||
|
||||
fn spanned_error_trait(input: &DeriveInput) -> TokenStream {
|
||||
let vis_span = match &input.vis {
|
||||
Visibility::Public(vis) => Some(vis.pub_token.span()),
|
||||
Visibility::Crate(vis) => Some(vis.crate_token.span()),
|
||||
Visibility::Restricted(vis) => Some(vis.pub_token.span()),
|
||||
Visibility::Public(vis) => Some(vis.pub_token.span),
|
||||
Visibility::Crate(vis) => Some(vis.crate_token.span),
|
||||
Visibility::Restricted(vis) => Some(vis.pub_token.span),
|
||||
Visibility::Inherited => None,
|
||||
};
|
||||
let data_span = match &input.data {
|
||||
Data::Struct(data) => data.struct_token.span(),
|
||||
Data::Enum(data) => data.enum_token.span(),
|
||||
Data::Union(data) => data.union_token.span(),
|
||||
Data::Struct(data) => data.struct_token.span,
|
||||
Data::Enum(data) => data.enum_token.span,
|
||||
Data::Union(data) => data.union_token.span,
|
||||
};
|
||||
let first_span = vis_span.unwrap_or(data_span);
|
||||
let last_span = input.ident.span();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue