@@ -133,11 +133,7 @@ pub(crate) fn text_edit_vec(
133133 line_endings : LineEndings ,
134134 text_edit : TextEdit ,
135135) -> Vec < lsp_types:: TextEdit > {
136- text_edit
137- . as_indels ( )
138- . iter ( )
139- . map ( |it| self :: text_edit ( line_index, line_endings, it. clone ( ) ) )
140- . collect ( )
136+ text_edit. into_iter ( ) . map ( |indel| self :: text_edit ( line_index, line_endings, indel) ) . collect ( )
141137}
142138
143139pub ( crate ) fn completion_item (
@@ -150,7 +146,7 @@ pub(crate) fn completion_item(
150146 // LSP does not allow arbitrary edits in completion, so we have to do a
151147 // non-trivial mapping here.
152148 let source_range = completion_item. source_range ( ) ;
153- for indel in completion_item. text_edit ( ) . as_indels ( ) {
149+ for indel in completion_item. text_edit ( ) . iter ( ) {
154150 if indel. delete . contains_range ( source_range) {
155151 text_edit = Some ( if indel. delete == source_range {
156152 self :: text_edit ( line_index, line_endings, indel. clone ( ) )
@@ -459,8 +455,7 @@ pub(crate) fn snippet_text_document_edit(
459455 let line_endings = world. file_line_endings ( source_file_edit. file_id ) ;
460456 let edits = source_file_edit
461457 . edit
462- . as_indels ( )
463- . iter ( )
458+ . into_iter ( )
464459 . map ( |it| snippet_text_edit ( & line_index, line_endings, is_snippet, it. clone ( ) ) )
465460 . collect ( ) ;
466461 Ok ( lsp_ext:: SnippetTextDocumentEdit { text_document, edits } )
0 commit comments