diff --git a/src/expr.rs b/src/expr.rs index b79137c4442..11194c7de72 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -360,8 +360,8 @@ pub(crate) fn format_expr( default_sp_delim(Some(lhs), Some(rhs)) }; rewrite_pair( - &*lhs, - &*rhs, + lhs, + rhs, PairParts::infix(&sp_delim), context, shape, @@ -374,7 +374,7 @@ pub(crate) fn format_expr( } else { default_sp_delim(None, Some(rhs)) }; - rewrite_unary_prefix(context, &sp_delim, &*rhs, shape) + rewrite_unary_prefix(context, &sp_delim, rhs, shape) } (Some(lhs), None) => { let sp_delim = if context.config.spaces_around_ranges() { @@ -382,7 +382,7 @@ pub(crate) fn format_expr( } else { default_sp_delim(Some(lhs), None) }; - rewrite_unary_suffix(context, &sp_delim, &*lhs, shape) + rewrite_unary_suffix(context, &sp_delim, lhs, shape) } (None, None) => Ok(delim.to_owned()), } diff --git a/src/items.rs b/src/items.rs index a2c0e8e0f50..8a311faad2a 100644 --- a/src/items.rs +++ b/src/items.rs @@ -1850,7 +1850,7 @@ fn rewrite_ty( } else { shape }; - rewrite_assign_rhs(context, lhs, &*ty, &RhsAssignKind::Ty, shape)? + rewrite_assign_rhs(context, lhs, ty, &RhsAssignKind::Ty, shape)? } else { result }; diff --git a/src/macros.rs b/src/macros.rs index 2d56021069c..b3189f84a09 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -1464,7 +1464,7 @@ fn format_lazy_static( result.push_str(&rewrite_assign_rhs( context, stmt, - &*expr, + expr, &RhsAssignKind::Expr(&expr.kind, expr.span), nested_shape.sub_width(1, expr.span)?, )?); diff --git a/src/matches.rs b/src/matches.rs index 4741abbe465..37663318bde 100644 --- a/src/matches.rs +++ b/src/matches.rs @@ -351,7 +351,7 @@ fn block_can_be_flattened<'a>( && is_simple_block(context, block, Some(&expr.attrs)) && !stmt_is_expr_mac(&block.stmts[0]) => { - Some(&*block) + Some(block) } _ => None, } @@ -381,16 +381,16 @@ fn flatten_arm_body<'a>( .and_then(|shape| rewrite_cond(context, expr, shape)) .map_or(false, |cond| cond.contains('\n')); if cond_becomes_multi_line { - (false, &*body) + (false, body) } else { - (can_extend(expr), &*expr) + (can_extend(expr), expr) } } } else { - (false, &*body) + (false, body) } } else { - (can_extend(body), &*body) + (can_extend(body), body) } } diff --git a/src/patterns.rs b/src/patterns.rs index df2a8dc5c6f..b0e2e75fd26 100644 --- a/src/patterns.rs +++ b/src/patterns.rs @@ -72,7 +72,7 @@ fn is_short_pattern_inner(context: &RewriteContext<'_>, pat: &ast::Pat) -> bool ast::PatKind::Box(ref p) | PatKind::Deref(ref p) | ast::PatKind::Ref(ref p, _, _) - | ast::PatKind::Paren(ref p) => is_short_pattern_inner(context, &*p), + | ast::PatKind::Paren(ref p) => is_short_pattern_inner(context, p), PatKind::Or(ref pats) => pats.iter().all(|p| is_short_pattern_inner(context, p)), } }