@@ -224,7 +224,7 @@ fn find_ids_for_dsym(
224224 if dirent. path( ) . extension( ) != Some ( OsStr :: new( "class" ) ) ;
225225 if let Ok ( dif) = DifFile :: open_path( dirent. path( ) , Some ( DifType :: Dsym ) ) ;
226226 then {
227- return Some ( extract_remaining_ids( & dif. ids( ) , remaining, DifType :: Dsym ) )
227+ return Some ( extract_remaining_ids( dif. ids( ) , remaining, DifType :: Dsym ) )
228228 }
229229 }
230230 None
@@ -237,7 +237,7 @@ fn find_ids_for_elf(
237237 if_chain ! {
238238 if let Ok ( dif) = DifFile :: open_path( dirent. path( ) , Some ( DifType :: Elf ) ) ;
239239 then {
240- return Some ( extract_remaining_ids( & dif. ids( ) , remaining, DifType :: Elf ) )
240+ return Some ( extract_remaining_ids( dif. ids( ) , remaining, DifType :: Elf ) )
241241 }
242242 }
243243 None
@@ -252,7 +252,7 @@ fn find_ids_for_pe(
252252 dirent. path( ) . extension( ) == Some ( OsStr :: new( "dll" ) ) ;
253253 if let Ok ( dif) = DifFile :: open_path( dirent. path( ) , Some ( DifType :: Pe ) ) ;
254254 then {
255- return Some ( extract_remaining_ids( & dif. ids( ) , remaining, DifType :: Pe ) )
255+ return Some ( extract_remaining_ids( dif. ids( ) , remaining, DifType :: Pe ) )
256256 }
257257 }
258258 None
@@ -266,7 +266,7 @@ fn find_ids_for_pdb(
266266 if dirent. path( ) . extension( ) == Some ( OsStr :: new( "pdb" ) ) ;
267267 if let Ok ( dif) = DifFile :: open_path( dirent. path( ) , Some ( DifType :: Pdb ) ) ;
268268 then {
269- return Some ( extract_remaining_ids( & dif. ids( ) , remaining, DifType :: Pdb ) )
269+ return Some ( extract_remaining_ids( dif. ids( ) , remaining, DifType :: Pdb ) )
270270 }
271271 }
272272 None
@@ -280,7 +280,7 @@ fn find_ids_for_portablepdb(
280280 if dirent. path( ) . extension( ) == Some ( OsStr :: new( "pdb" ) ) ;
281281 if let Ok ( dif) = DifFile :: open_path( dirent. path( ) , Some ( DifType :: PortablePdb ) ) ;
282282 then {
283- return Some ( extract_remaining_ids( & dif. ids( ) , remaining, DifType :: PortablePdb ) )
283+ return Some ( extract_remaining_ids( dif. ids( ) , remaining, DifType :: PortablePdb ) )
284284 }
285285 }
286286 None
@@ -294,7 +294,7 @@ fn find_ids_for_sourcebundle(
294294 if dirent. path( ) . extension( ) == Some ( OsStr :: new( "zip" ) ) ;
295295 if let Ok ( dif) = DifFile :: open_path( dirent. path( ) , Some ( DifType :: SourceBundle ) ) ;
296296 then {
297- return Some ( extract_remaining_ids( & dif. ids( ) , remaining, DifType :: SourceBundle ) )
297+ return Some ( extract_remaining_ids( dif. ids( ) , remaining, DifType :: SourceBundle ) )
298298 }
299299 }
300300 None
@@ -308,25 +308,27 @@ fn find_ids_for_breakpad(
308308 if dirent. path( ) . extension( ) == Some ( OsStr :: new( "sym" ) ) ;
309309 if let Ok ( dif) = DifFile :: open_path( dirent. path( ) , Some ( DifType :: Breakpad ) ) ;
310310 then {
311- return Some ( extract_remaining_ids( & dif. ids( ) , remaining, DifType :: Breakpad ) )
311+ return Some ( extract_remaining_ids( dif. ids( ) , remaining, DifType :: Breakpad ) )
312312 }
313313 }
314314 None
315315}
316316
317- fn extract_remaining_ids (
318- ids : & [ DebugId ] ,
317+ fn extract_remaining_ids < I > (
318+ ids : I ,
319319 remaining : & HashSet < DebugId > ,
320320 t : DifType ,
321- ) -> Vec < ( DebugId , DifType ) > {
322- ids. iter ( )
323- . filter_map ( |id| {
324- if remaining. contains ( id) {
325- return Some ( ( id. to_owned ( ) , t) ) ;
326- }
327- None
328- } )
329- . collect ( )
321+ ) -> Vec < ( DebugId , DifType ) >
322+ where
323+ I : Iterator < Item = DebugId > ,
324+ {
325+ ids. filter_map ( |id| {
326+ if remaining. contains ( & id) {
327+ return Some ( ( id. to_owned ( ) , t) ) ;
328+ }
329+ None
330+ } )
331+ . collect ( )
330332}
331333
332334pub fn execute ( matches : & ArgMatches ) -> Result < ( ) > {
0 commit comments