From 7416164b198ecbfda88e7a37ef381cc1a6011ac2 Mon Sep 17 00:00:00 2001 From: hinto-janai Date: Thu, 25 Jul 2024 17:47:39 -0400 Subject: [PATCH] workspace: fix lint error (#234) * cargo.toml: split `keyword_idents` lint * dandelion-tower: fix doc * fix doc/clippy --- Cargo.toml | 3 ++- helper/src/time.rs | 2 +- p2p/dandelion-tower/src/pool.rs | 2 +- p2p/p2p/src/block_downloader.rs | 2 +- p2p/p2p/src/block_downloader/block_queue.rs | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9b090ba6..22a15855 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -275,7 +275,8 @@ clone_on_ref_ptr = "deny" # Cold absolute_paths_not_starting_with_crate = "deny" explicit_outlives_requirements = "deny" -keyword_idents = "deny" +keyword_idents_2018 = "deny" +keyword_idents_2024 = "deny" missing_abi = "deny" non_ascii_idents = "deny" non_local_definitions = "deny" diff --git a/helper/src/time.rs b/helper/src/time.rs index 7bc155f6..28aff7f5 100644 --- a/helper/src/time.rs +++ b/helper/src/time.rs @@ -55,7 +55,7 @@ pub const fn unix_clock(seconds_after_unix_epoch: u64) -> u32 { /// - The seconds returned is guaranteed to be `0..=59` /// - The minutes returned is guaranteed to be `0..=59` /// - The hours returned can be over `23`, as this is not a clock function, -/// see [`secs_to_clock`] for clock-like behavior that wraps around on `24` +/// see [`secs_to_clock`] for clock-like behavior that wraps around on `24` /// /// ```rust /// # use cuprate_helper::time::*; diff --git a/p2p/dandelion-tower/src/pool.rs b/p2p/dandelion-tower/src/pool.rs index 68f79451..5f4f7346 100644 --- a/p2p/dandelion-tower/src/pool.rs +++ b/p2p/dandelion-tower/src/pool.rs @@ -51,7 +51,7 @@ use crate::{ /// /// - `buffer_size` is the size of the channel's buffer between the [`DandelionPoolService`] and [`DandelionPool`]. /// - `dandelion_router` is the router service, kept generic instead of [`DandelionRouter`](crate::DandelionRouter) to allow -/// user to customise routing functionality. +/// user to customise routing functionality. /// - `backing_pool` is the backing transaction storage service /// - `config` is [`DandelionConfig`]. pub fn start_dandelion_pool( diff --git a/p2p/p2p/src/block_downloader.rs b/p2p/p2p/src/block_downloader.rs index 81640e90..5f530546 100644 --- a/p2p/p2p/src/block_downloader.rs +++ b/p2p/p2p/src/block_downloader.rs @@ -194,7 +194,7 @@ where /// - download the next batch of blocks /// - request the next chain entry /// - download an already requested batch of blocks (this might happen due to an error in the previous request -/// or because the queue of ready blocks is too large, so we need the oldest block to clear it). +/// or because the queue of ready blocks is too large, so we need the oldest block to clear it). struct BlockDownloader { /// The client pool. client_pool: Arc>, diff --git a/p2p/p2p/src/block_downloader/block_queue.rs b/p2p/p2p/src/block_downloader/block_queue.rs index d846c22c..708eb3ed 100644 --- a/p2p/p2p/src/block_downloader/block_queue.rs +++ b/p2p/p2p/src/block_downloader/block_queue.rs @@ -140,6 +140,7 @@ mod tests { proptest! { #[test] + #[allow(clippy::mutable_key_type)] fn block_queue_returns_items_in_order(batches in vec(ready_batch_strategy(), 0..10_000)) { block_on(async move { let (buffer_tx, mut buffer_rx) = cuprate_async_buffer::new_buffer(usize::MAX);