Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
squadgazzz committed Mar 14, 2024
1 parent fc9a848 commit e3fee14
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ impl Configuration {
}
}

#[allow(dead_code)]
fn collect_required_environment_variable(key: &str) -> Result<String> {
Ok(env::var(key).context(format!("required environment variable {} not set", key))?)
env::var(key).context(format!("required environment variable {} not set", key))
}

fn collect_optional_environment_variable(key: &str) -> Result<Option<String>> {
Expand Down
1 change: 1 addition & 0 deletions src/cow_api_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ impl CowAPIClient {
})
}

#[allow(clippy::too_many_arguments)]
pub async fn create_order(
&self,
order_contract: Address,
Expand Down
1 change: 1 addition & 0 deletions src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use hex::FromHex;

use crate::constants::{APP_DATA, ERC20_BALANCE, KIND_SELL};

#[allow(clippy::too_many_arguments)]
pub fn get_eip_1271_signature(
from_token: Address,
to_token: Address,
Expand Down
3 changes: 2 additions & 1 deletion src/ethereum_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ impl EthereumClient {
.map(|block_num: U64| block_num.try_into().unwrap()) // U64 -> u64 should always work
}

#[allow(dead_code)]
pub async fn get_chain_timestamp(&self) -> Result<u64> {
Ok(self.get_latest_block().await?.timestamp.as_u64())
}
Expand Down Expand Up @@ -234,7 +235,7 @@ mod tests {
.await
.expect("Unable to get requested swaps");

assert!(requested_swaps.len() > 0);
assert!(!requested_swaps.is_empty());
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async fn main() {
}
};

if requested_swaps.len() > 0 {
if !requested_swaps.is_empty() {
info!(
"Found {} requested swaps between blocks {} and {}",
requested_swaps.len(),
Expand Down

0 comments on commit e3fee14

Please sign in to comment.