From 55fbfdb2c4cdbea3a609d1376452316e5232fe78 Mon Sep 17 00:00:00 2001 From: zvolin Date: Fri, 29 Nov 2024 11:26:40 +0100 Subject: [PATCH] new toolchain alignments --- grpc/tests/tonic.rs | 1 + grpc/tests/{utils.rs => utils/mod.rs} | 0 node/src/block_ranges.rs | 2 +- node/src/store/utils.rs | 2 +- node/tests/graceful_stop.rs | 1 + node/tests/header_ex.rs | 1 + node/tests/node.rs | 1 + node/tests/shwap.rs | 1 + rpc/tests/blob.rs | 1 + rpc/tests/header.rs | 1 + rpc/tests/p2p.rs | 1 + rpc/tests/share.rs | 1 + rpc/tests/state.rs | 1 + rpc/tests/wasm.rs | 1 + types/src/data_availability_header.rs | 2 +- 15 files changed, 14 insertions(+), 3 deletions(-) rename grpc/tests/{utils.rs => utils/mod.rs} (100%) diff --git a/grpc/tests/tonic.rs b/grpc/tests/tonic.rs index 07d1387af..20abd71f3 100644 --- a/grpc/tests/tonic.rs +++ b/grpc/tests/tonic.rs @@ -1,3 +1,4 @@ +#![allow(missing_docs)] #![cfg(not(target_arch = "wasm32"))] use celestia_grpc::types::auth::Account; diff --git a/grpc/tests/utils.rs b/grpc/tests/utils/mod.rs similarity index 100% rename from grpc/tests/utils.rs rename to grpc/tests/utils/mod.rs diff --git a/node/src/block_ranges.rs b/node/src/block_ranges.rs index 5d3c573bb..7e208e3b9 100644 --- a/node/src/block_ranges.rs +++ b/node/src/block_ranges.rs @@ -49,7 +49,7 @@ pub(crate) trait BlockRangeExt { pub(crate) struct BlockRangeDisplay<'a>(&'a RangeInclusive); -impl<'a> Display for BlockRangeDisplay<'a> { +impl Display for BlockRangeDisplay<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}-{}", self.0.start(), self.0.end()) } diff --git a/node/src/store/utils.rs b/node/src/store/utils.rs index 63beb893a..f285e64c1 100644 --- a/node/src/store/utils.rs +++ b/node/src/store/utils.rs @@ -55,7 +55,7 @@ impl From for VerifiedExtendedHeaders { } } -impl<'a> From<&'a ExtendedHeader> for VerifiedExtendedHeaders { +impl From<&'_ ExtendedHeader> for VerifiedExtendedHeaders { fn from(value: &ExtendedHeader) -> Self { Self(vec![value.to_owned()]) } diff --git a/node/tests/graceful_stop.rs b/node/tests/graceful_stop.rs index 953851b0c..e241fe0c5 100644 --- a/node/tests/graceful_stop.rs +++ b/node/tests/graceful_stop.rs @@ -1,3 +1,4 @@ +#![allow(missing_docs)] #![cfg(not(target_arch = "wasm32"))] use std::path::Path; diff --git a/node/tests/header_ex.rs b/node/tests/header_ex.rs index 57b199452..da0c0b158 100644 --- a/node/tests/header_ex.rs +++ b/node/tests/header_ex.rs @@ -1,3 +1,4 @@ +#![allow(missing_docs)] #![cfg(not(target_arch = "wasm32"))] use std::time::Duration; diff --git a/node/tests/node.rs b/node/tests/node.rs index ac7101216..3d36bd446 100644 --- a/node/tests/node.rs +++ b/node/tests/node.rs @@ -1,3 +1,4 @@ +#![allow(missing_docs)] #![cfg(not(target_arch = "wasm32"))] use std::time::Duration; diff --git a/node/tests/shwap.rs b/node/tests/shwap.rs index 343fb47a5..1715ad59d 100644 --- a/node/tests/shwap.rs +++ b/node/tests/shwap.rs @@ -1,3 +1,4 @@ +#![allow(missing_docs)] #![cfg(not(target_arch = "wasm32"))] use std::{collections::HashSet, time::Duration}; diff --git a/rpc/tests/blob.rs b/rpc/tests/blob.rs index 575772700..50ce067fb 100644 --- a/rpc/tests/blob.rs +++ b/rpc/tests/blob.rs @@ -1,3 +1,4 @@ +#![allow(missing_docs)] #![cfg(not(target_arch = "wasm32"))] use std::cmp::Ordering; diff --git a/rpc/tests/header.rs b/rpc/tests/header.rs index 304e82287..357d7752f 100644 --- a/rpc/tests/header.rs +++ b/rpc/tests/header.rs @@ -1,3 +1,4 @@ +#![allow(missing_docs)] #![cfg(not(target_arch = "wasm32"))] use celestia_rpc::prelude::*; diff --git a/rpc/tests/p2p.rs b/rpc/tests/p2p.rs index 164ecf340..a151b025f 100644 --- a/rpc/tests/p2p.rs +++ b/rpc/tests/p2p.rs @@ -1,3 +1,4 @@ +#![allow(missing_docs)] #![cfg(all(not(target_arch = "wasm32"), feature = "p2p"))] use crate::utils::client::{new_test_client, AuthLevel}; use celestia_rpc::prelude::*; diff --git a/rpc/tests/share.rs b/rpc/tests/share.rs index 16f7cad3e..add6f6a01 100644 --- a/rpc/tests/share.rs +++ b/rpc/tests/share.rs @@ -1,3 +1,4 @@ +#![allow(missing_docs)] #![cfg(not(target_arch = "wasm32"))] use celestia_rpc::prelude::*; diff --git a/rpc/tests/state.rs b/rpc/tests/state.rs index 9e535914b..9ac52a28a 100644 --- a/rpc/tests/state.rs +++ b/rpc/tests/state.rs @@ -1,3 +1,4 @@ +#![allow(missing_docs)] #![cfg(not(target_arch = "wasm32"))] use crate::utils::{random_bytes, random_ns}; diff --git a/rpc/tests/wasm.rs b/rpc/tests/wasm.rs index 7a02026e3..933b69032 100644 --- a/rpc/tests/wasm.rs +++ b/rpc/tests/wasm.rs @@ -1,3 +1,4 @@ +#![allow(missing_docs)] #![cfg(all(target_arch = "wasm32", feature = "wasm-bindgen"))] use celestia_rpc::client::Client; diff --git a/types/src/data_availability_header.rs b/types/src/data_availability_header.rs index dbe5e2acf..4d2343c54 100644 --- a/types/src/data_availability_header.rs +++ b/types/src/data_availability_header.rs @@ -208,7 +208,7 @@ impl DataAvailabilityHeader { proofs.push(MerkleProof::new(idx as usize, &all_roots)?.0); let row = self .row_root(idx) - .ok_or_else(|| Error::IndexOutOfRange(idx as usize, self.row_roots.len()))?; + .ok_or(Error::IndexOutOfRange(idx as usize, self.row_roots.len()))?; row_roots.push(row); }