Skip to content

Commit 95bece4

Browse files
committed
Fix lints
1 parent 5c08f3f commit 95bece4

File tree

4 files changed

+4
-192
lines changed

4 files changed

+4
-192
lines changed

source/compiler/qsc_openqasm_compiler/src/keyword.rs

Lines changed: 0 additions & 167 deletions
This file was deleted.

source/compiler/qsc_openqasm_compiler/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
mod ast_builder;
1818
pub mod compiler;
1919
pub mod display_utils;
20-
mod keyword;
2120
mod types;
2221

2322
#[cfg(test)]

source/compiler/qsc_openqasm_parser/src/stdlib/complex.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@ pub struct Complex {
1616
}
1717

1818
impl Complex {
19+
#[must_use]
1920
pub fn new(real: f64, imag: f64) -> Self {
2021
Self { real, imag }
2122
}
2223

24+
#[must_use]
2325
pub fn real(real: f64) -> Self {
2426
Self { real, imag: 0. }
2527
}
2628

29+
#[must_use]
2730
pub fn imag(imag: f64) -> Self {
2831
Self { real: 0., imag }
2932
}
@@ -109,6 +112,7 @@ impl Div for Complex {
109112

110113
impl Complex {
111114
/// This mimics Q#'s `PowC` implementation.
115+
#[must_use]
112116
pub fn pow(self, rhs: Self) -> Self {
113117
let (a, b) = (self.real, self.imag);
114118
let (c, d) = (rhs.real, rhs.imag);

source/compiler/qsc_openqasm_parser/src/tests.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use expect_test::Expect;
55
use miette::Report;
66

77
use crate::io::InMemorySourceResolver;
8-
use crate::io::SourceResolver;
98
use crate::semantic::QasmSemanticParseResult;
109
use crate::semantic::parse_source;
1110
use std::sync::Arc;
@@ -29,29 +28,6 @@ pub(crate) fn parse<S: Into<Arc<str>>>(
2928
Ok(res)
3029
}
3130

32-
pub(crate) fn parse_all<P: Into<Arc<str>>>(
33-
path: P,
34-
sources: impl IntoIterator<Item = (Arc<str>, Arc<str>)>,
35-
) -> miette::Result<QasmSemanticParseResult, Vec<Report>> {
36-
let path = path.into();
37-
let mut resolver = InMemorySourceResolver::from_iter(sources);
38-
let source = resolver
39-
.resolve(&path, &path)
40-
.map_err(|e| vec![Report::new(e)])?
41-
.1;
42-
let res = parse_source(source, path, &mut resolver);
43-
if res.source.has_errors() {
44-
let errors = res
45-
.errors()
46-
.into_iter()
47-
.map(|e| Report::new(e.clone()))
48-
.collect();
49-
Err(errors)
50-
} else {
51-
Ok(res)
52-
}
53-
}
54-
5531
pub fn check_qasm<S: Into<Arc<str>>>(source: S, expect: &Expect) {
5632
match parse(source) {
5733
Ok(res) => {

0 commit comments

Comments
 (0)