From 9f379db471382a6dde432686e263324f15b95c12 Mon Sep 17 00:00:00 2001 From: Oscar Puente <156957451+orpuente-MS@users.noreply.github.com> Date: Thu, 30 Jan 2025 11:18:40 -0800 Subject: [PATCH] allow unused functions in the meantime --- compiler/qsc_qasm3/src/lex.rs | 2 +- compiler/qsc_qasm3/src/lex/cooked.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/qsc_qasm3/src/lex.rs b/compiler/qsc_qasm3/src/lex.rs index df04e5d460..34683c5259 100644 --- a/compiler/qsc_qasm3/src/lex.rs +++ b/compiler/qsc_qasm3/src/lex.rs @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +#![allow(unused)] pub mod cooked; pub mod raw; - use enum_iterator::Sequence; pub(super) use cooked::{Error, Lexer, Token, TokenKind}; diff --git a/compiler/qsc_qasm3/src/lex/cooked.rs b/compiler/qsc_qasm3/src/lex/cooked.rs index 63eae6c144..5b9c41fcf7 100644 --- a/compiler/qsc_qasm3/src/lex/cooked.rs +++ b/compiler/qsc_qasm3/src/lex/cooked.rs @@ -459,7 +459,7 @@ impl<'a> Lexer<'a> { let mut iter = tokens.iter(); while self.next_if_eq(*(iter.next().expect("tokens should have at least one token"))) { for token in iter { - self.expect(*token, complete)? + self.expect(*token, complete)?; } iter = tokens.iter(); } @@ -482,7 +482,7 @@ impl<'a> Lexer<'a> { } raw::TokenKind::Ident => { let ident = &self.input[(token.offset as usize)..(self.offset() as usize)]; - Ok(Some(self.ident(ident))) + Ok(Some(Self::ident(ident))) } raw::TokenKind::HardwareQubit => Ok(Some(TokenKind::HardwareQubit)), raw::TokenKind::LiteralFragment(_) => { @@ -650,7 +650,7 @@ impl<'a> Lexer<'a> { } } - fn ident(&mut self, ident: &str) -> TokenKind { + fn ident(ident: &str) -> TokenKind { match ident { "gphase" => TokenKind::GPhase, "inv" => TokenKind::Inv,