11// Copyright 2021-2023 Protocol Labs
22// SPDX-License-Identifier: Apache-2.0, MIT
33use std:: borrow:: Borrow ;
4- use std:: fmt:: Display ;
54use std:: iter:: FusedIterator ;
65
76use forest_hash_utils:: BytesKey ;
@@ -39,7 +38,7 @@ impl<'a, V> From<std::slice::Iter<'a, V>> for StackItem<'a, V> {
3938 }
4039}
4140
42- impl < ' a , V > From < std:: vec:: IntoIter < V > > for StackItem < ' a , V > {
41+ impl < V > From < std:: vec:: IntoIter < V > > for StackItem < ' _ , V > {
4342 fn from ( value : std:: vec:: IntoIter < V > ) -> Self {
4443 Self :: IntoIter ( value)
4544 }
@@ -62,12 +61,6 @@ pub enum IterItem<'a, V> {
6261 Owned ( V ) ,
6362}
6463
65- impl < V : Display > Display for IterItem < ' _ , V > {
66- fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
67- self . as_ref ( ) . fmt ( f)
68- }
69- }
70-
7164impl < V > AsRef < V > for IterItem < ' _ , V > {
7265 fn as_ref ( & self ) -> & V {
7366 match self {
@@ -77,17 +70,7 @@ impl<V> AsRef<V> for IterItem<'_, V> {
7770 }
7871}
7972
80- impl < V : PartialEq > PartialEq < V > for IterItem < ' _ , V > {
81- fn eq ( & self , other : & V ) -> bool {
82- self . as_ref ( ) . eq ( other)
83- }
84-
85- fn ne ( & self , other : & V ) -> bool {
86- self . as_ref ( ) . ne ( other)
87- }
88- }
89-
90- impl < ' a , V > From < V > for IterItem < ' a , V > {
73+ impl < V > From < V > for IterItem < ' _ , V > {
9174 fn from ( value : V ) -> Self {
9275 Self :: Owned ( value)
9376 }
@@ -140,6 +123,7 @@ where
140123 }
141124 IterItem :: Owned ( node) => {
142125 stack. push ( StackItem :: from (
126+ #[ allow( clippy:: unnecessary_to_owned) ]
143127 node. pointers [ node. index_for_bit_pos ( idx) ..]
144128 . to_vec ( )
145129 . into_iter ( ) ,
@@ -173,6 +157,7 @@ where
173157 conf,
174158 store,
175159 stack,
160+ #[ allow( clippy:: unnecessary_to_owned) ]
176161 current : values[ offset..] . to_vec ( ) . into_iter ( ) . into ( ) ,
177162 } ) ,
178163 None => Err ( Error :: StartKeyNotFound ) ,
0 commit comments