Skip to content

Commit 9bc01e4

Browse files
committed
satisfy linter
1 parent 38ba8d6 commit 9bc01e4

5 files changed

Lines changed: 5 additions & 9 deletions

File tree

src/front/zsharp/parser.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,7 @@ impl<'a> Loader for &'a ZLoad {
126126
debug!("Parsing: {}", p.as_ref().display());
127127
let s = self.sources.alloc(s);
128128
let ast = ast::generate_ast(s);
129-
if ast.is_err() {
130-
panic!("{}", ast.unwrap_err());
131-
}
132-
Ok(ast.unwrap())
129+
Ok(ast.unwrap_or_else(|e| panic!("{}", e)))
133130
}
134131
fn includes<P: AsRef<Path>>(&self, ast: &Self::AST, p: &P) -> Vec<PathBuf> {
135132
let mut c = p.as_ref().to_path_buf();

src/front/zsharp/zvisit/zconstlitrw.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ impl<'ast> ZVisitorMut<'ast> for ZConstLiteralRewriter {
9797
&mut self,
9898
dle: &mut ast::DecimalLiteralExpression<'ast>,
9999
) -> ZVisitorResult {
100+
#![allow(clippy::unnecessary_unwrap)]
100101
if dle.suffix.is_none() && self.to_ty.is_some() {
101102
self.found = true;
102103
dle.suffix.replace(match self.to_ty.as_ref().unwrap() {

src/front/zsharpcurly/parser.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,7 @@ impl<'a> Loader for &'a ZLoad {
126126
debug!("Parsing: {}", p.as_ref().display());
127127
let s = self.sources.alloc(s);
128128
let ast = ast::generate_ast(s);
129-
if ast.is_err() {
130-
panic!("{}", ast.unwrap_err());
131-
}
132-
Ok(ast.unwrap())
129+
Ok(ast.unwrap_or_else(|e| panic!("{}", e)))
133130
}
134131
fn includes<P: AsRef<Path>>(&self, ast: &Self::AST, p: &P) -> Vec<PathBuf> {
135132
let mut c = p.as_ref().to_path_buf();

src/front/zsharpcurly/zvisit/zconstlitrw.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ impl<'ast> ZVisitorMut<'ast> for ZConstLiteralRewriter {
113113
&mut self,
114114
dle: &mut ast::DecimalLiteralExpression<'ast>,
115115
) -> ZVisitorResult {
116+
#![allow(clippy::unnecessary_unwrap)]
116117
if dle.suffix.is_none() && self.to_ty.is_some() {
117118
self.found = true;
118119
dle.suffix.replace(match self.to_ty.as_ref().unwrap() {

src/ir/term/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
//! * [Computation]: a collection of variables and assertions about them
2121
//! * [Value]: a variable-free (and evaluated) term
2222
//!
23+
#![allow(clippy::derive_ord_xor_partial_ord)]
2324

2425
use circ_fields::{FieldT, FieldV};
2526
pub use circ_hc::{Node, Table, Weak};
@@ -795,7 +796,6 @@ impl Array {
795796
impl std::cmp::Eq for Value {}
796797
// We walk in danger here, intentionally. One day we may fix it.
797798
// FP is the heart of the problem.
798-
#[allow(clippy::derive_ord_xor_partial_ord)]
799799
impl std::cmp::Ord for Value {
800800
fn cmp(&self, o: &Self) -> std::cmp::Ordering {
801801
self.partial_cmp(o).expect("broken Value cmp")

0 commit comments

Comments
 (0)