Skip to content

Commit 50b49e9

Browse files
orpuente-MSidavis
authored andcommitted
remove extra scope
1 parent 0b52ae9 commit 50b49e9

File tree

1 file changed

+21
-23
lines changed
  • compiler/qsc_qasm3/src/parser

1 file changed

+21
-23
lines changed

Diff for: compiler/qsc_qasm3/src/parser/expr.rs

+21-23
Original file line numberDiff line numberDiff line change
@@ -409,30 +409,28 @@ fn lit_bigint(lexeme: &str, radix: u32) -> Option<BigInt> {
409409
}
410410

411411
fn timing_literal(lexeme: &str, token: Token, kind: TimingLiteralKind) -> Result<Option<Lit>> {
412-
{
413-
let lexeme = lexeme
414-
.chars()
415-
.filter(|x| *x != '_')
416-
.take_while(|x| x.is_numeric() || *x == '.')
417-
.collect::<String>();
418-
419-
let value = lexeme
420-
.parse()
421-
.map_err(|_| Error::new(ErrorKind::Lit("timing", token.span)))?;
422-
423-
let unit = match kind {
424-
TimingLiteralKind::Dt => TimeUnit::Dt,
425-
TimingLiteralKind::Ns => TimeUnit::Ns,
426-
TimingLiteralKind::Us => TimeUnit::Us,
427-
TimingLiteralKind::Ms => TimeUnit::Ms,
428-
TimingLiteralKind::S => TimeUnit::S,
429-
};
412+
let lexeme = lexeme
413+
.chars()
414+
.filter(|x| *x != '_')
415+
.take_while(|x| x.is_numeric() || *x == '.')
416+
.collect::<String>();
417+
418+
let value = lexeme
419+
.parse()
420+
.map_err(|_| Error::new(ErrorKind::Lit("timing", token.span)))?;
421+
422+
let unit = match kind {
423+
TimingLiteralKind::Dt => TimeUnit::Dt,
424+
TimingLiteralKind::Ns => TimeUnit::Ns,
425+
TimingLiteralKind::Us => TimeUnit::Us,
426+
TimingLiteralKind::Ms => TimeUnit::Ms,
427+
TimingLiteralKind::S => TimeUnit::S,
428+
};
430429

431-
Ok(Some(Lit {
432-
span: token.span,
433-
kind: LiteralKind::Duration { value, unit },
434-
}))
435-
}
430+
Ok(Some(Lit {
431+
span: token.span,
432+
kind: LiteralKind::Duration { value, unit },
433+
}))
436434
}
437435

438436
pub(crate) fn paren_expr(s: &mut ParserContext, lo: u32) -> Result<Expr> {

0 commit comments

Comments
 (0)