@@ -430,22 +430,24 @@ mod tests {
430430 // file_system_edits:
431431 // MoveFile AnchoredPathBuf { anchor: FileId(2), path: "foo2.rs", }
432432
433- let mut source_file_edits = HashMap :: new ( ) ;
434- for ( id, ( text_edit, _) ) in source_change. source_file_edits {
435- let indels = text_edit. into_iter ( ) . collect :: < Vec < _ > > ( ) ;
436- source_file_edits. insert ( id, indels) ;
437- }
438-
439- let mut file_system_edits = HashMap :: new ( ) ;
440- for a in source_change. file_system_edits {
441- let id = match & a {
442- FileSystemEdit :: CreateFile { dst, initial_contents } => unreachable ! ( ) ,
443- FileSystemEdit :: MoveFile { src, dst } => src,
444- FileSystemEdit :: MoveDir { src, src_id, dst } => src_id,
445- }
446- . clone ( ) ;
447- file_system_edits. insert ( id, a) ;
448- }
433+ let source_file_edits = source_change
434+ . source_file_edits
435+ . into_iter ( )
436+ . map ( |( a, ( b, _) ) | ( a, b. into_iter ( ) . collect :: < Vec < _ > > ( ) ) )
437+ . collect :: < HashMap < _ , _ > > ( ) ;
438+
439+ let file_system_edits = source_change
440+ . file_system_edits
441+ . into_iter ( )
442+ . map ( |a| {
443+ let id = match & a {
444+ FileSystemEdit :: CreateFile { .. } => unreachable ! ( ) ,
445+ FileSystemEdit :: MoveFile { src, .. } => src,
446+ FileSystemEdit :: MoveDir { src_id, .. } => src_id,
447+ } ;
448+ ( id. clone ( ) , a)
449+ } )
450+ . collect :: < HashMap < _ , _ > > ( ) ;
449451
450452 let b = format ! (
451453 "source_file_edits: {:#?}\n file_system_edits: {:#?}" ,
0 commit comments