more clippy fixes:

clippy::search_is_some
clippy::redundant_static_lifetimes
clippy::match_single_binding
clippy::match_ref_pats
clippy::map_entry
clippy::manual_map
clippy::iter_overeager_cloned
clippy::into_iter_on_ref
clippy::extra_unused_lifetimes
This commit is contained in:
Matthias Krüger 2022-03-12 15:57:57 +01:00
parent 56e4ea59d9
commit 5a0078c9d1
6 changed files with 15 additions and 24 deletions

View file

@ -241,8 +241,8 @@ pub fn eval_const(expr: &Expr, ctx: &mut ConstEvalCtx<'_>) -> Result<ComputedExp
Expr::Block { statements, tail, .. } => {
let mut prev_values = HashMap::<Name, Option<ComputedExpr>>::default();
for statement in &**statements {
match statement {
&hir_def::expr::Statement::Let { pat, initializer, .. } => {
match *statement {
hir_def::expr::Statement::Let { pat, initializer, .. } => {
let pat = &ctx.pats[pat];
let name = match pat {
Pat::Bind { name, subpat, .. } if subpat.is_none() => name.clone(),
@ -261,7 +261,7 @@ pub fn eval_const(expr: &Expr, ctx: &mut ConstEvalCtx<'_>) -> Result<ComputedExp
ctx.local_data.insert(name, value);
}
}
&hir_def::expr::Statement::Expr { .. } => {
hir_def::expr::Statement::Expr { .. } => {
return Err(ConstEvalError::NotSupported("this kind of statement"))
}
}