1
Fork 0

2 - Make more use of let_chains

Continuation of #94376.

cc #53667
This commit is contained in:
Caio 2022-02-26 13:45:36 -03:00
parent 6f681a8eb3
commit ef5601b321
5 changed files with 50 additions and 56 deletions

View file

@ -222,10 +222,10 @@ impl Lit {
}
token::Literal(lit) => lit,
token::Interpolated(ref nt) => {
if let token::NtExpr(expr) | token::NtLiteral(expr) = &**nt {
if let ast::ExprKind::Lit(lit) = &expr.kind {
return Ok(lit.clone());
}
if let token::NtExpr(expr) | token::NtLiteral(expr) = &**nt
&& let ast::ExprKind::Lit(lit) = &expr.kind
{
return Ok(lit.clone());
}
return Err(LitError::NotLiteral);
}