Skip to content

Commit 7d18098

Browse files
authored
clippy: add doc-valid-idents (#378)
apply
1 parent d5dd70a commit 7d18098

File tree

5 files changed

+22
-15
lines changed

5 files changed

+22
-15
lines changed

clippy.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
# <https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms>
2-
upper-case-acronyms-aggressive = true
2+
upper-case-acronyms-aggressive = true
3+
4+
# <https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown>
5+
doc-valid-idents = [
6+
"RandomX",
7+
# This adds the rest of the default exceptions.
8+
".."
9+
]

consensus/context/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ pub struct NewBlockData {
192192
/// A request to the blockchain context cache.
193193
#[derive(Debug, Clone)]
194194
pub enum BlockChainContextRequest {
195-
/// Gets all the current `RandomX` VMs.
195+
/// Gets all the current RandomX VMs.
196196
CurrentRxVms,
197197

198198
/// Get the next difficulties for these blocks.
@@ -294,7 +294,7 @@ pub enum BlockChainContextRequest {
294294
/// This variant is private and is not callable from outside this crate, the block verifier service will
295295
/// handle getting the randomX VM of an alt chain.
296296
AltChainRxVM {
297-
/// The height the `RandomX` VM is needed for.
297+
/// The height the RandomX VM is needed for.
298298
height: usize,
299299
/// The chain to look in for the seed.
300300
chain: Chain,
@@ -327,7 +327,7 @@ pub enum BlockChainContextResponse {
327327

328328
/// Response to [`BlockChainContextRequest::CurrentRxVms`]
329329
///
330-
/// A map of seed height to `RandomX` VMs.
330+
/// A map of seed height to RandomX VMs.
331331
RxVms(HashMap<usize, Arc<RandomXVm>>),
332332

333333
/// A list of difficulties.

consensus/context/src/rx_vms.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
//! `RandomX` VM Cache
1+
//! RandomX VM Cache
22
//!
3-
//! This module keeps track of the `RandomX` VM to calculate the next blocks proof-of-work, if the block needs a randomX VM and potentially
3+
//! This module keeps track of the RandomX VM to calculate the next blocks proof-of-work, if the block needs a randomX VM and potentially
44
//! more VMs around this height.
55
//!
66
use std::{
@@ -34,11 +34,11 @@ pub const RX_SEEDS_CACHED: usize = 2;
3434
/// A multithreaded randomX VM.
3535
#[derive(Debug)]
3636
pub struct RandomXVm {
37-
/// These `RandomX` VMs all share the same cache.
37+
/// These RandomX VMs all share the same cache.
3838
vms: ThreadLocal<VmInner>,
39-
/// The `RandomX` cache.
39+
/// The RandomX cache.
4040
cache: RandomXCache,
41-
/// The flags used to start the `RandomX` VMs.
41+
/// The flags used to start the RandomX VMs.
4242
flags: RandomXFlag,
4343
}
4444

@@ -161,7 +161,7 @@ impl RandomXVmCache {
161161
Ok(alt_vm)
162162
}
163163

164-
/// Get the main-chain `RandomX` VMs.
164+
/// Get the main-chain RandomX VMs.
165165
pub async fn get_vms(&mut self) -> HashMap<usize, Arc<RandomXVm>> {
166166
match self.seeds.len().checked_sub(self.vms.len()) {
167167
// No difference in the amount of seeds to VMs.
@@ -213,7 +213,7 @@ impl RandomXVmCache {
213213
self.vms.clone()
214214
}
215215

216-
/// Removes all the `RandomX` VMs above the `new_height`.
216+
/// Removes all the RandomX VMs above the `new_height`.
217217
pub fn pop_blocks_main_chain(&mut self, new_height: usize) {
218218
self.seeds.retain(|(height, _)| *height < new_height);
219219
self.vms.retain(|height, _| *height < new_height);

consensus/rules/src/blocks.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,19 @@ pub enum BlockError {
4444
MinerTxError(#[from] MinerTxError),
4545
}
4646

47-
/// A trait to represent the `RandomX` VM.
47+
/// A trait to represent the RandomX VM.
4848
pub trait RandomX {
4949
type Error;
5050

5151
fn calculate_hash(&self, buf: &[u8]) -> Result<[u8; 32], Self::Error>;
5252
}
5353

54-
/// Returns if this height is a `RandomX` seed height.
54+
/// Returns if this height is a RandomX seed height.
5555
pub const fn is_randomx_seed_height(height: usize) -> bool {
5656
height % RX_SEEDHASH_EPOCH_BLOCKS == 0
5757
}
5858

59-
/// Returns the `RandomX` seed height for this block.
59+
/// Returns the RandomX seed height for this block.
6060
///
6161
/// ref: <https://monero-book.cuprate.org/consensus_rules/blocks.html#randomx-seed>
6262
pub const fn randomx_seed_height(height: usize) -> usize {

consensus/src/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl PreparedBlock {
154154
///
155155
/// # Panics
156156
/// This function will panic if `randomx_vm` is
157-
/// [`None`] even though `RandomX` is needed.
157+
/// [`None`] even though RandomX is needed.
158158
fn new_prepped<R: RandomX>(
159159
block: PreparedBlockExPow,
160160
randomx_vm: Option<&R>,

0 commit comments

Comments
 (0)