Skip to content

Commit

Permalink
Merge branch 'main' into ssz-version-bumps
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhauner authored Jan 6, 2025
2 parents 23b6d86 + 194e929 commit 1df8db7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "milhouse"
version = "0.3.0"
version = "0.4.0"
description = "Persistent binary merkle tree"
edition = "2021"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl<T: Value> Builder<T> {

let length = self.length.as_usize();
let level_capacity = 1 << self.level;
let mut next_index_on_level = (length + level_capacity - 1) / level_capacity;
let mut next_index_on_level = length.div_ceil(level_capacity);

// Finish any partially-filled packed leaf.
if let Some(packing_factor) = self.packing_factor {
Expand Down
6 changes: 3 additions & 3 deletions src/cow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub enum Cow<'a, T: Clone> {
Vec(VecCow<'a, T>),
}

impl<'a, T: Clone> Deref for Cow<'a, T> {
impl<T: Clone> Deref for Cow<'_, T> {
type Target = T;

fn deref(&self) -> &T {
Expand Down Expand Up @@ -77,7 +77,7 @@ impl<'a, T: Clone> CowTrait<'a, T> for BTreeCow<'a, T> {
}
}

impl<'a, T: Clone> Deref for BTreeCow<'a, T> {
impl<T: Clone> Deref for BTreeCow<'_, T> {
type Target = T;

fn deref(&self) -> &T {
Expand Down Expand Up @@ -125,7 +125,7 @@ impl<'a, T: Clone> CowTrait<'a, T> for VecCow<'a, T> {
}
}

impl<'a, T: Clone> Deref for VecCow<'a, T> {
impl<T: Clone> Deref for VecCow<'_, T> {
type Target = T;

fn deref(&self) -> &T {
Expand Down
4 changes: 2 additions & 2 deletions src/interface_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl<'a, T: Value, U: UpdateMap<T>> Iterator for InterfaceIter<'a, T, U> {
}
}

impl<'a, T: Value, U: UpdateMap<T>> ExactSizeIterator for InterfaceIter<'a, T, U> {}
impl<T: Value, U: UpdateMap<T>> ExactSizeIterator for InterfaceIter<'_, T, U> {}

#[derive(Debug)]
pub struct InterfaceIterCow<'a, T: Value, U: UpdateMap<T>> {
Expand All @@ -38,7 +38,7 @@ pub struct InterfaceIterCow<'a, T: Value, U: UpdateMap<T>> {
pub(crate) index: usize,
}

impl<'a, T: Value, U: UpdateMap<T>> InterfaceIterCow<'a, T, U> {
impl<T: Value, U: UpdateMap<T>> InterfaceIterCow<'_, T, U> {
pub fn next_cow(&mut self) -> Option<(usize, Cow<T>)> {
let index = self.index;
self.index += 1;
Expand Down
2 changes: 1 addition & 1 deletion src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ impl<'a, T: Value> Iterator for Iter<'a, T> {
}
}

impl<'a, T: Value> ExactSizeIterator for Iter<'a, T> {}
impl<T: Value> ExactSizeIterator for Iter<'_, T> {}

0 comments on commit 1df8db7

Please sign in to comment.