clippy::useless_conversion
This commit is contained in:
parent
5a2dd7d4f3
commit
6d064295c8
13 changed files with 20 additions and 28 deletions
|
@ -383,7 +383,7 @@ impl<'a> Parser<'a> {
|
|||
self.capture_state
|
||||
.parser_replacements
|
||||
.drain(parser_replacements_start..parser_replacements_end)
|
||||
.chain(inner_attr_parser_replacements.into_iter())
|
||||
.chain(inner_attr_parser_replacements)
|
||||
.map(|(parser_range, data)| {
|
||||
(NodeRange::new(parser_range, collect_pos.start_pos), data)
|
||||
})
|
||||
|
|
|
@ -1588,7 +1588,7 @@ impl<'a> Parser<'a> {
|
|||
(thin_vec![], Recovered::Yes(guar))
|
||||
}
|
||||
};
|
||||
VariantData::Struct { fields, recovered: recovered.into() }
|
||||
VariantData::Struct { fields, recovered }
|
||||
} else if this.check(&token::OpenDelim(Delimiter::Parenthesis)) {
|
||||
let body = match this.parse_tuple_struct_body() {
|
||||
Ok(body) => body,
|
||||
|
@ -1672,7 +1672,7 @@ impl<'a> Parser<'a> {
|
|||
class_name.span,
|
||||
generics.where_clause.has_where_token,
|
||||
)?;
|
||||
VariantData::Struct { fields, recovered: recovered.into() }
|
||||
VariantData::Struct { fields, recovered }
|
||||
}
|
||||
// No `where` so: `struct Foo<T>;`
|
||||
} else if self.eat(&token::Semi) {
|
||||
|
@ -1684,7 +1684,7 @@ impl<'a> Parser<'a> {
|
|||
class_name.span,
|
||||
generics.where_clause.has_where_token,
|
||||
)?;
|
||||
VariantData::Struct { fields, recovered: recovered.into() }
|
||||
VariantData::Struct { fields, recovered }
|
||||
// Tuple-style struct definition with optional where-clause.
|
||||
} else if self.token == token::OpenDelim(Delimiter::Parenthesis) {
|
||||
let body = VariantData::Tuple(self.parse_tuple_struct_body()?, DUMMY_NODE_ID);
|
||||
|
@ -1713,14 +1713,14 @@ impl<'a> Parser<'a> {
|
|||
class_name.span,
|
||||
generics.where_clause.has_where_token,
|
||||
)?;
|
||||
VariantData::Struct { fields, recovered: recovered.into() }
|
||||
VariantData::Struct { fields, recovered }
|
||||
} else if self.token == token::OpenDelim(Delimiter::Brace) {
|
||||
let (fields, recovered) = self.parse_record_struct_body(
|
||||
"union",
|
||||
class_name.span,
|
||||
generics.where_clause.has_where_token,
|
||||
)?;
|
||||
VariantData::Struct { fields, recovered: recovered.into() }
|
||||
VariantData::Struct { fields, recovered }
|
||||
} else {
|
||||
let token_str = super::token_descr(&self.token);
|
||||
let msg = format!("expected `where` or `{{` after union name, found {token_str}");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue