Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ all = "warn"

[lints.clippy]
all = { level = "warn", priority = -1 }
missing-const-for-fn = "allow" # TODO: https://github.com/rust-lang/rust-clippy/issues/14020
missing-const-for-fn = "warn"
use-self = "warn"
redundant-clone = "warn"
result_large_err = "allow"
Expand Down
4 changes: 2 additions & 2 deletions src/mask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ impl TrieMask {

/// Set bit at a specified index.
#[inline]
pub fn set_bit(&mut self, index: u8) {
pub const fn set_bit(&mut self, index: u8) {
self.0 |= 1u16 << index;
}

/// Unset bit at a specified index.
#[inline]
pub fn unset_bit(&mut self, index: u8) {
pub const fn unset_bit(&mut self, index: u8) {
self.0 &= !(1u16 << index);
}
}
2 changes: 1 addition & 1 deletion src/nodes/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl<'a> ExtensionNodeRef<'a> {

/// Returns the length of RLP encoded fields of extension node.
#[inline]
fn rlp_payload_length(&self) -> usize {
const fn rlp_payload_length(&self) -> usize {
let mut encoded_key_len = self.key.len() / 2 + 1;
// For extension nodes the first byte cannot be greater than 0x80.
if encoded_key_len != 1 {
Expand Down
2 changes: 1 addition & 1 deletion src/proof/added_removed_keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl AddedRemovedKeys {
/// Sets the `assume_added` flag, which can be used instead of `insert_added` if exact
/// additions aren't known and you want to optimistically collect all proofs which _might_ be
/// necessary.
pub fn with_assume_added(mut self, assume_added: bool) -> Self {
pub const fn with_assume_added(mut self, assume_added: bool) -> Self {
self.assume_added = assume_added;
self
}
Expand Down
Loading