avoid converting types into themselves (clippy::useless_conversion)

This commit is contained in:
Matthias Krüger 2021-02-17 20:37:09 +01:00
parent ee88f46bb5
commit ec50a2086a
6 changed files with 7 additions and 8 deletions

View file

@ -97,7 +97,7 @@ impl<'a> Parser<'a> {
self.mk_stmt(lo, StmtKind::Empty)
} else if self.token != token::CloseDelim(token::Brace) {
// Remainder are line-expr stmts.
let e = self.parse_expr_res(Restrictions::STMT_EXPR, Some(attrs.into()))?;
let e = self.parse_expr_res(Restrictions::STMT_EXPR, Some(attrs))?;
self.mk_stmt(lo.to(e.span), StmtKind::Expr(e))
} else {
self.error_outer_attrs(&attrs.take_for_recovery());
@ -131,7 +131,7 @@ impl<'a> Parser<'a> {
};
let expr = this.with_res(Restrictions::STMT_EXPR, |this| {
let expr = this.parse_dot_or_call_expr_with(expr, lo, attrs.into())?;
let expr = this.parse_dot_or_call_expr_with(expr, lo, attrs)?;
this.parse_assoc_expr_with(0, LhsExpr::AlreadyParsed(expr))
})?;
Ok((
@ -213,7 +213,7 @@ impl<'a> Parser<'a> {
}
fn recover_local_after_let(&mut self, lo: Span, attrs: AttrVec) -> PResult<'a, Stmt> {
let local = self.parse_local(attrs.into())?;
let local = self.parse_local(attrs)?;
Ok(self.mk_stmt(lo.to(self.prev_token.span), StmtKind::Local(local)))
}