Skip to content

Commit

Permalink
Fix nightly clippy warnings (#925)
Browse files Browse the repository at this point in the history
* Derive `Default`

* Fix `field is never read`
  • Loading branch information
cmichi authored Sep 17, 2021
1 parent c2ea64b commit 4155ebe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
8 changes: 4 additions & 4 deletions crates/env/src/engine/on_chain/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ where
/// The internal Wasm32 raw pointer value.
///
/// Must not be readable or directly usable by any safe Rust code.
value: u32,
_value: u32,
/// We handle types like these as if the associated lifetime was exclusive.
marker: PhantomData<fn() -> &'a T>,
}
Expand All @@ -111,7 +111,7 @@ where
/// Creates a new Wasm32 pointer for the given raw pointer value.
fn new(value: u32) -> Self {
Self {
value,
_value: value,
marker: Default::default(),
}
}
Expand Down Expand Up @@ -142,7 +142,7 @@ where
/// The internal Wasm32 raw pointer value.
///
/// Must not be readable or directly usable by any safe Rust code.
value: u32,
_value: u32,
/// We handle types like these as if the associated lifetime was exclusive.
marker: PhantomData<fn() -> &'a mut T>,
}
Expand All @@ -154,7 +154,7 @@ where
/// Creates a new Wasm32 pointer for the given raw pointer value.
fn new(value: u32) -> Self {
Self {
value,
_value: value,
marker: Default::default(),
}
}
Expand Down
10 changes: 1 addition & 9 deletions crates/storage/src/collections/bitvec/bits256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,12 @@ use super::{
};

/// A chunk of 256 bits.
#[derive(Debug, Copy, Clone, PartialEq, Eq, scale::Encode, scale::Decode)]
#[derive(Debug, Copy, Clone, Default, PartialEq, Eq, scale::Encode, scale::Decode)]
#[cfg_attr(feature = "std", derive(scale_info::TypeInfo))]
pub struct Bits256 {
bits: [Bits64; 4],
}

impl Default for Bits256 {
fn default() -> Self {
Self {
bits: Default::default(),
}
}
}

/// Iterator over the valid bits of a pack of 256 bits.
#[derive(Debug, Copy, Clone)]
pub struct Iter<'a> {
Expand Down

0 comments on commit 4155ebe

Please sign in to comment.