Skip to content

Commit

Permalink
remove superfluous warning and clippy allows (#194)
Browse files Browse the repository at this point in the history
Signed-off-by: xermicus <[email protected]>
  • Loading branch information
xermicus authored Feb 5, 2025
1 parent 35419e8 commit 157647d
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ format:
cargo fmt --all --check

clippy:
cargo clippy --all-features --workspace --tests --benches -- --deny warnings --allow dead_code
cargo clippy --all-features --workspace --tests --benches -- --deny warnings

machete:
cargo install cargo-machete
Expand Down
1 change: 0 additions & 1 deletion crates/llvm-context/src/debug_config/ir_type.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! The debug IR type.
/// The debug IR type.
#[allow(non_camel_case_types)]
#[allow(clippy::upper_case_acronyms)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum IRType {
Expand Down
1 change: 0 additions & 1 deletion crates/llvm-context/src/polkavm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ pub fn build_assembly_text(
}

/// Implemented by items which are translated into LLVM IR.
#[allow(clippy::upper_case_acronyms)]
pub trait WriteLLVM<D>
where
D: Dependency + Clone,
Expand Down
2 changes: 0 additions & 2 deletions crates/solidity/src/const.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//! Solidity to PolkaVM compiler constants.
#![allow(dead_code)]

/// The default executable name.
pub static DEFAULT_EXECUTABLE_NAME: &str = "resolc";

Expand Down
1 change: 0 additions & 1 deletion crates/solidity/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ pub fn standard_output<T: Compiler>(
}

/// Runs the standard JSON mode.
#[allow(clippy::too_many_arguments)]
pub fn standard_json<T: Compiler>(
solc: &mut T,
detect_missing_libraries: bool,
Expand Down
2 changes: 0 additions & 2 deletions crates/solidity/src/project/contract/ir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ use self::yul::Yul;

/// The contract source code.
#[derive(Debug, Serialize, Deserialize, Clone)]
#[allow(non_camel_case_types)]
#[allow(clippy::upper_case_acronyms)]
#[allow(clippy::enum_variant_names)]
pub enum IR {
/// The Yul source code.
Yul(Yul),
Expand Down
17 changes: 6 additions & 11 deletions crates/solidity/src/resolc/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ pub struct Arguments {

impl Arguments {
/// Validates the arguments.
#[allow(clippy::collapsible_if)]
pub fn validate(&self) -> anyhow::Result<()> {
if self.version && std::env::args().count() > 2 {
anyhow::bail!("No other options are allowed while getting the compiler version.");
Expand Down Expand Up @@ -236,18 +235,14 @@ impl Arguments {
}
}

if self.llvm_ir {
if self.solc.is_some() {
anyhow::bail!("`solc` is not used in LLVM IR and PolkaVM assembly modes.");
}
if self.llvm_ir && self.solc.is_some() {
anyhow::bail!("`solc` is not used in LLVM IR and PolkaVM assembly modes.");
}

if self.combined_json.is_some() {
if self.output_assembly || self.output_binary {
anyhow::bail!(
"Cannot output assembly or binary outside of JSON in combined JSON mode."
);
}
if self.combined_json.is_some() && (self.output_assembly || self.output_binary) {
anyhow::bail!(
"Cannot output assembly or binary outside of JSON in combined JSON mode."
);
}

if self.standard_json {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use serde::Serialize;

/// The `solc --standard-json` expected output selection flag.
#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq, Hash)]
#[allow(non_camel_case_types)]
#[allow(clippy::upper_case_acronyms)]
pub enum Flag {
/// The ABI JSON.
#[serde(rename = "abi")]
Expand Down
1 change: 0 additions & 1 deletion crates/solidity/src/yul/lexer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ impl Lexer {
}

/// Advances the lexer, returning the next lexeme.
#[allow(clippy::should_implement_trait)]
pub fn next(&mut self) -> Result<Token, Error> {
if let Some(peeked) = self.peeked.take() {
return Ok(peeked);
Expand Down

0 comments on commit 157647d

Please sign in to comment.