@@ -66,12 +66,6 @@ pub(crate) fn find_in_slice(bytes: &[u8], search_for: &str) -> Result<Option<Fil
66
66
search_for : String ,
67
67
}
68
68
69
- impl FindFileListVisitor {
70
- pub fn new ( path : String ) -> Self {
71
- FindFileListVisitor { search_for : path }
72
- }
73
- }
74
-
75
69
impl < ' de > Visitor < ' de > for FindFileListVisitor {
76
70
type Value = Option < FileInfo > ;
77
71
@@ -91,12 +85,6 @@ pub(crate) fn find_in_slice(bytes: &[u8], search_for: &str) -> Result<Option<Fil
91
85
search_for : String ,
92
86
}
93
87
94
- impl FindFileVisitor {
95
- pub fn new ( search_for : String ) -> Self {
96
- FindFileVisitor { search_for }
97
- }
98
- }
99
-
100
88
impl < ' de > DeserializeSeed < ' de > for FindFileVisitor {
101
89
type Value = Option < FileInfo > ;
102
90
fn deserialize < D > ( self , deserializer : D ) -> Result < Self :: Value , D :: Error >
@@ -140,7 +128,9 @@ pub(crate) fn find_in_slice(bytes: &[u8], search_for: &str) -> Result<Option<Fil
140
128
141
129
while let Some ( key) = map. next_key :: < & str > ( ) ? {
142
130
if key == "files" {
143
- return map. next_value_seed ( FindFileVisitor :: new ( self . search_for ) ) ;
131
+ return map. next_value_seed ( FindFileVisitor {
132
+ search_for : self . search_for ,
133
+ } ) ;
144
134
}
145
135
}
146
136
@@ -159,7 +149,10 @@ pub(crate) fn find_in_slice(bytes: &[u8], search_for: &str) -> Result<Option<Fil
159
149
}
160
150
}
161
151
162
- Ok ( FindFileListVisitor :: new ( search_for. to_string ( ) ) . deserialize ( & mut deserializer) ?)
152
+ Ok ( FindFileListVisitor {
153
+ search_for : search_for. to_string ( ) ,
154
+ }
155
+ . deserialize ( & mut deserializer) ?)
163
156
}
164
157
165
158
pub ( crate ) fn find_in_file < P : AsRef < Path > > (
0 commit comments