@@ -432,13 +432,12 @@ fn build_source_change(
432432 assoc_item_list. add_items ( & mut editor, items. clone ( ) ) ;
433433
434434 // Add tabstop for last method
435- if let Some ( cap) = ctx. config . snippet_cap {
436- if let Some ( ast:: AssocItem :: Fn ( fn_) ) = items. last ( ) {
437- if let Some ( name) = fn_. name ( ) {
438- let tabstop = builder. make_tabstop_before ( cap) ;
439- editor. add_annotation ( name. syntax ( ) . clone ( ) , tabstop) ;
440- }
441- }
435+ if let Some ( cap) = ctx. config . snippet_cap
436+ && let Some ( ast:: AssocItem :: Fn ( fn_) ) = items. last ( )
437+ && let Some ( name) = fn_. name ( )
438+ {
439+ let tabstop = builder. make_tabstop_before ( cap) ;
440+ editor. add_annotation ( name. syntax ( ) . clone ( ) , tabstop) ;
442441 }
443442
444443 builder. add_file_edits ( ctx. vfs_file_id ( ) , editor) ;
@@ -463,15 +462,13 @@ fn build_source_change(
463462 ) ;
464463
465464 // Add tabstop for last method
466- if let Some ( cap) = ctx. config . snippet_cap {
467- if let Some ( assoc_list) = impl_def. assoc_item_list ( ) {
468- if let Some ( ast:: AssocItem :: Fn ( fn_) ) = assoc_list. assoc_items ( ) . last ( ) {
469- if let Some ( name) = fn_. name ( ) {
470- let tabstop = builder. make_tabstop_before ( cap) ;
471- editor. add_annotation ( name. syntax ( ) . clone ( ) , tabstop) ;
472- }
473- }
474- }
465+ if let Some ( cap) = ctx. config . snippet_cap
466+ && let Some ( assoc_list) = impl_def. assoc_item_list ( )
467+ && let Some ( ast:: AssocItem :: Fn ( fn_) ) = assoc_list. assoc_items ( ) . last ( )
468+ && let Some ( name) = fn_. name ( )
469+ {
470+ let tabstop = builder. make_tabstop_before ( cap) ;
471+ editor. add_annotation ( name. syntax ( ) . clone ( ) , tabstop) ;
475472 }
476473
477474 builder. add_file_edits ( ctx. vfs_file_id ( ) , editor) ;
0 commit comments