1
1
// Copyright 2021-2023 Protocol Labs
2
2
// SPDX-License-Identifier: Apache-2.0, MIT
3
3
use std:: borrow:: Borrow ;
4
- use std:: fmt:: Display ;
5
4
use std:: iter:: FusedIterator ;
6
5
7
6
use forest_hash_utils:: BytesKey ;
@@ -39,7 +38,7 @@ impl<'a, V> From<std::slice::Iter<'a, V>> for StackItem<'a, V> {
39
38
}
40
39
}
41
40
42
- impl < ' a , V > From < std:: vec:: IntoIter < V > > for StackItem < ' a , V > {
41
+ impl < V > From < std:: vec:: IntoIter < V > > for StackItem < ' _ , V > {
43
42
fn from ( value : std:: vec:: IntoIter < V > ) -> Self {
44
43
Self :: IntoIter ( value)
45
44
}
@@ -62,12 +61,6 @@ pub enum IterItem<'a, V> {
62
61
Owned ( V ) ,
63
62
}
64
63
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
-
71
64
impl < V > AsRef < V > for IterItem < ' _ , V > {
72
65
fn as_ref ( & self ) -> & V {
73
66
match self {
@@ -77,17 +70,7 @@ impl<V> AsRef<V> for IterItem<'_, V> {
77
70
}
78
71
}
79
72
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 > {
91
74
fn from ( value : V ) -> Self {
92
75
Self :: Owned ( value)
93
76
}
@@ -140,6 +123,7 @@ where
140
123
}
141
124
IterItem :: Owned ( node) => {
142
125
stack. push ( StackItem :: from (
126
+ #[ allow( clippy:: unnecessary_to_owned) ]
143
127
node. pointers [ node. index_for_bit_pos ( idx) ..]
144
128
. to_vec ( )
145
129
. into_iter ( ) ,
@@ -173,6 +157,7 @@ where
173
157
conf,
174
158
store,
175
159
stack,
160
+ #[ allow( clippy:: unnecessary_to_owned) ]
176
161
current : values[ offset..] . to_vec ( ) . into_iter ( ) . into ( ) ,
177
162
} ) ,
178
163
None => Err ( Error :: StartKeyNotFound ) ,
0 commit comments