Skip to content

Commit 2a4df30

Browse files
committed
Fix clippy warning
1 parent a67bfbc commit 2a4df30

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

collector/src/bin/collector.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ use tonic::transport::{channel::Channel, ClientTlsConfig};
1111
#[macro_use]
1212
extern crate log;
1313

14-
#[allow(clippy::large_enum_variant, clippy::enum_variant_names)]
14+
#[allow(
15+
clippy::large_enum_variant,
16+
clippy::enum_variant_names,
17+
clippy::doc_overindented_list_items
18+
)]
1519
mod grpc {
1620
mod plt {
1721
tonic::include_proto!("concordium.v2.plt");
@@ -208,7 +212,7 @@ async fn main() {
208212
}
209213

210214
#[allow(clippy::cognitive_complexity)]
211-
async fn collect_data<'a>(
215+
async fn collect_data(
212216
node_name: NodeName,
213217
grpc_host: String,
214218
conf: &ConfigCli,

concordium-node/src/bin/bootstrap_checker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn main() -> anyhow::Result<()> {
3737
let regenesis_arc: Arc<Regenesis> = Arc::new(Regenesis::from_blocks(regenesis_blocks));
3838

3939
ensure!(
40-
regenesis_arc.blocks.read().unwrap().len() > 0,
40+
!regenesis_arc.blocks.read().unwrap().is_empty(),
4141
"Bootstrapper can't run without specifying genesis hashes."
4242
);
4343

concordium-node/src/bin/bootstrapper.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async fn main() -> anyhow::Result<()> {
4040
let regenesis_arc: Arc<Regenesis> = Arc::new(Regenesis::from_blocks(regenesis_blocks));
4141

4242
ensure!(
43-
regenesis_arc.blocks.read().unwrap().len() > 0,
43+
!regenesis_arc.blocks.read().unwrap().is_empty(),
4444
"Bootstrapper can't run without specifying genesis hashes."
4545
);
4646

concordium-node/src/consensus_ffi/ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2383,7 +2383,7 @@ impl ConsensusContainer {
23832383
use crate::grpc2::Require;
23842384
let bhi = crate::grpc2::types::block_hash_input_to_ffi(block_hash).require()?;
23852385
let (block_id_type, block_hash) = bhi.to_ptr();
2386-
let token_id_len = token_id.value.as_bytes().len();
2386+
let token_id_len = token_id.value.len();
23872387
if token_id_len > 255 {
23882388
return Err(tonic::Status::invalid_argument(
23892389
"TokenId: length must be at most 255 bytes",

concordium-node/src/health.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ enum ServiceError<'a> {
5151
ServiceNotFound { service: &'a str },
5252
}
5353

54-
impl<'a> ServiceError<'a> {
54+
impl ServiceError<'_> {
5555
pub fn is_not_found(&self) -> bool {
5656
matches!(self, Self::ServiceNotFound { .. })
5757
}

0 commit comments

Comments
 (0)