Skip to content

Commit

Permalink
Merge pull request #638 from input-output-hk/fix-imhamt-box-lints
Browse files Browse the repository at this point in the history
imhamt: remove nested boxes
  • Loading branch information
Mikhail Zabaluev committed Sep 10, 2021
2 parents b0f70b8 + 2830fd1 commit 26e1fd2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions imhamt/src/node/reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ pub struct Node<K, V> {

pub type NodeIter<'a, K, V> = slice::Iter<'a, SharedRef<Entry<K, V>>>;

pub struct Collision<K, V>(Box<Box<[(K, V)]>>);
pub struct Collision<K, V>(Box<[(K, V)]>);

impl<K, V> Collision<K, V> {
pub fn from_vec(vec: Vec<(K, V)>) -> Self {
assert!(vec.len() >= 2);
Collision(Box::new(vec.into()))
Collision(vec.into())
}
pub fn from_box(b: Box<[(K, V)]>) -> Self {
assert!(b.len() >= 2);
Collision(Box::new(b))
Collision(b)
}
pub fn len(&self) -> usize {
self.0.len()
Expand Down

0 comments on commit 26e1fd2

Please sign in to comment.