mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
fix clippy::needless_borrow
This commit is contained in:
parent
ff7e057dca
commit
7912e33ed6
36 changed files with 74 additions and 77 deletions
|
@ -293,7 +293,7 @@ pub fn eval_const(expr: &Expr, ctx: &mut ConstEvalCtx<'_>) -> Result<ComputedExp
|
|||
|
||||
pub fn eval_usize(expr: Idx<Expr>, mut ctx: ConstEvalCtx<'_>) -> Option<u64> {
|
||||
let expr = &ctx.exprs[expr];
|
||||
if let Ok(ce) = eval_const(&expr, &mut ctx) {
|
||||
if let Ok(ce) = eval_const(expr, &mut ctx) {
|
||||
match ce {
|
||||
ComputedExpr::Literal(Literal::Int(x, _)) => return x.try_into().ok(),
|
||||
ComputedExpr::Literal(Literal::Uint(x, _)) => return x.try_into().ok(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue