parent
6f681a8eb3
commit
ef5601b321
5 changed files with 50 additions and 56 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue