Skip to content

Commit 870e255

Browse files
svyatonikbkontur
authored andcommitted
Some code grooming (#2276)
* some code grooming: enable warn(missing_docs) for all piblic crates + added missing documentation + removed obsolete clippy/deny workarounds * removed strange allow + added comment related to other allow * removed incorrect_clone_impl_on_copy_type which is unknown to CI clippy
1 parent 353ad62 commit 870e255

File tree

2 files changed

+2
-34
lines changed

2 files changed

+2
-34
lines changed

bridges/primitives/runtime/src/lib.rs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -457,38 +457,6 @@ macro_rules! generate_static_str_provider {
457457
};
458458
}
459459

460-
/// Error message that is only displayable in `std` environment.
461-
#[derive(Encode, Decode, Clone, Eq, PartialEq, PalletError, TypeInfo)]
462-
#[scale_info(skip_type_params(T))]
463-
pub struct StrippableError<T> {
464-
_phantom_data: sp_std::marker::PhantomData<T>,
465-
#[codec(skip)]
466-
#[cfg(feature = "std")]
467-
message: String,
468-
}
469-
470-
impl<T: Debug> From<T> for StrippableError<T> {
471-
fn from(_err: T) -> Self {
472-
Self {
473-
_phantom_data: Default::default(),
474-
#[cfg(feature = "std")]
475-
message: format!("{:?}", _err),
476-
}
477-
}
478-
}
479-
480-
impl<T> Debug for StrippableError<T> {
481-
#[cfg(feature = "std")]
482-
fn fmt(&self, f: &mut sp_std::fmt::Formatter<'_>) -> sp_std::fmt::Result {
483-
f.write_str(&self.message)
484-
}
485-
486-
#[cfg(not(feature = "std"))]
487-
fn fmt(&self, f: &mut sp_std::fmt::Formatter<'_>) -> sp_std::fmt::Result {
488-
f.write_str("Stripped error")
489-
}
490-
}
491-
492460
/// A trait defining helper methods for `RangeInclusive` (start..=end)
493461
pub trait RangeInclusiveExt<Idx> {
494462
/// Computes the length of the `RangeInclusive`, checking for underflow and overflow.

bridges/primitives/runtime/src/storage_proof.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,13 @@ impl VerifiedStorageProof {
260260
#[cfg(feature = "test-helpers")]
261261
#[derive(Clone, Copy, Debug, Default)]
262262
pub struct UnverifiedStorageProofParams {
263-
#[allow(missing_docs)]
263+
/// Expected storage proof size in bytes.
264264
pub db_size: Option<u32>,
265265
}
266266

267267
#[cfg(feature = "test-helpers")]
268268
impl UnverifiedStorageProofParams {
269-
#[allow(missing_docs)]
269+
/// Make storage proof parameters that require proof of at least `db_size` bytes.
270270
pub fn from_db_size(db_size: u32) -> Self {
271271
Self { db_size: Some(db_size) }
272272
}

0 commit comments

Comments
 (0)