Skip to content

Commit

Permalink
Lints
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronFeickert committed Apr 1, 2024
1 parent 3be811c commit 25ff611
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 54 deletions.
21 changes: 5 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion base_layer/contacts/Cargo.toml
Expand Up @@ -23,7 +23,7 @@ diesel = { version = "2.0.3", features = ["sqlite", "serde_json", "chrono", "64-
diesel_migrations = "2.0.0"
futures = { version = "^0.3.1", features = ["compat", "std"] }
log = "0.4.6"
num-derive = "0.3.3"
num-derive = "0.4.2"
num-traits = "0.2.15"
prost = "0.11.9"
rand = "0.8"
Expand Down
2 changes: 1 addition & 1 deletion base_layer/core/Cargo.toml
Expand Up @@ -74,7 +74,7 @@ log-mdc = "0.1.0"
monero = { version = "0.20.0", features = ["serde-crate"], optional = true }
newtype-ops = "0.1.4"
num-traits = "0.2.15"
num-derive = "0.3.3"
num-derive = "0.4.2"
num-format = "0.4.0"
once_cell = "1.8.0"
prost = "0.11.9"
Expand Down
1 change: 1 addition & 0 deletions base_layer/core/src/proof_of_work/proof_of_work.rs
Expand Up @@ -29,6 +29,7 @@ use tari_utilities::hex::Hex;

use crate::proof_of_work::PowAlgorithm;

#[allow(dead_code)]
pub trait AchievedDifficulty {}

/// The proof of work data structure that is included in the block header. There's some non-Rustlike redundancy here
Expand Down
1 change: 1 addition & 0 deletions base_layer/p2p/src/dns/mock.rs
Expand Up @@ -87,6 +87,7 @@ pub fn message(query: Query, answers: Vec<Record>, name_servers: Vec<Record>, ad
}

pub trait OnSend: Clone + Send + Sync + 'static {
#[allow(dead_code)]
fn on_send<E>(
&mut self,
response: Result<DnsResponse, E>,
Expand Down
8 changes: 4 additions & 4 deletions base_layer/p2p/src/services/liveness/state.rs
Expand Up @@ -162,7 +162,7 @@ impl LivenessState {

/// Returns true if the nonce is inflight, otherwise false
pub fn is_inflight(&self, nonce: u64) -> bool {
self.inflight_pings.get(&nonce).is_some()
self.inflight_pings.contains_key(&nonce)
}

/// Records a pong. Specifically, the pong counter is incremented and
Expand Down Expand Up @@ -345,8 +345,8 @@ mod test {
state.add_inflight_ping(2, peer2.clone());
state.add_inflight_ping(3, peer2.clone());

assert!(state.failed_pings.get(&peer1).is_none());
assert!(state.failed_pings.get(&peer2).is_none());
assert!(!state.failed_pings.contains_key(&peer1));
assert!(!state.failed_pings.contains_key(&peer2));

// MAX_INFLIGHT_TTL passes
for n in [1, 2, 3] {
Expand All @@ -363,6 +363,6 @@ mod test {
assert!(state.record_pong(2, &peer2).is_none());
let n = state.failed_pings.get(&peer1).unwrap();
assert_eq!(*n, 1);
assert!(state.failed_pings.get(&peer2).is_none());
assert!(!state.failed_pings.contains_key(&peer2));
}
}
1 change: 0 additions & 1 deletion base_layer/wallet/src/lib.rs
Expand Up @@ -17,7 +17,6 @@ pub mod output_manager_service;
pub mod storage;
pub mod test_utils;
pub mod transaction_service;
pub mod types;

pub use tari_common_types::types::WalletHasher;
pub mod util;
Expand Down
29 changes: 0 additions & 29 deletions base_layer/wallet/src/types.rs

This file was deleted.

2 changes: 1 addition & 1 deletion comms/dht/examples/graphing_utilities/utilities.rs
Expand Up @@ -43,7 +43,7 @@ static GRAPH_FRAME_NUM: Lazy<Mutex<HashMap<String, usize>>> = Lazy::new(|| Mutex
fn get_next_frame_num(name: &str) -> usize {
let mut map = GRAPH_FRAME_NUM.lock().unwrap();
let current: usize;
match (*map).get_mut(&name.to_string()) {
match (*map).get_mut(name) {
None => {
current = 0;
(*map).insert(name.to_string(), 1);
Expand Down
2 changes: 1 addition & 1 deletion lints.toml
Expand Up @@ -15,7 +15,6 @@ deny = [
# Common mistakes
'clippy::await_holding_lock',
'unused_variables',
'unused_imports',
'dead_code',
'unused_extern_crates',
'unused_must_use',
Expand Down Expand Up @@ -70,4 +69,5 @@ allow = [
# `assert!(!foo(bar))` is misread the majority of the time, while `assert_eq!(foo(bar), false)` is crystal clear
'clippy::bool-assert-comparison',
'clippy::blocks_in_conditions',
'unused_imports', # TODO: DENY THIS
]

0 comments on commit 25ff611

Please sign in to comment.