@@ -29,8 +29,8 @@ impl IntoIterator for CompletionsResult {
2929 }
3030}
3131
32- pub ( crate ) fn get_statement_for_completions < ' a > (
33- doc : & ' a ParsedDocument ,
32+ pub ( crate ) fn get_statement_for_completions (
33+ doc : & ParsedDocument ,
3434 position : TextSize ,
3535) -> Option < ( StatementId , TextRange , String , Arc < tree_sitter:: Tree > ) > {
3636 let count = doc. count ( ) ;
@@ -89,7 +89,7 @@ mod tests {
8989 (
9090 ParsedDocument :: new (
9191 PgTPath :: new ( "test.sql" ) ,
92- sql. replace ( CURSOR_POSITION , "" ) . into ( ) ,
92+ sql. replace ( CURSOR_POSITION , "" ) ,
9393 5 ,
9494 ) ,
9595 TextSize :: new ( pos) ,
@@ -119,14 +119,11 @@ mod tests {
119119
120120 #[ test]
121121 fn does_not_break_when_no_statements_exist ( ) {
122- let sql = format ! ( "{}" , CURSOR_POSITION ) ;
122+ let sql = CURSOR_POSITION . to_string ( ) ;
123123
124124 let ( doc, position) = get_doc_and_pos ( sql. as_str ( ) ) ;
125125
126- assert ! ( matches!(
127- get_statement_for_completions( & doc, position) ,
128- None
129- ) ) ;
126+ assert ! ( get_statement_for_completions( & doc, position) . is_none( ) ) ;
130127 }
131128
132129 #[ test]
@@ -138,10 +135,7 @@ mod tests {
138135 // make sure these are parsed as two
139136 assert_eq ! ( doc. count( ) , 2 ) ;
140137
141- assert ! ( matches!(
142- get_statement_for_completions( & doc, position) ,
143- None
144- ) ) ;
138+ assert ! ( get_statement_for_completions( & doc, position) . is_none( ) ) ;
145139 }
146140
147141 #[ test]
@@ -174,10 +168,7 @@ mod tests {
174168
175169 let ( doc, position) = get_doc_and_pos ( sql. as_str ( ) ) ;
176170
177- assert ! ( matches!(
178- get_statement_for_completions( & doc, position) ,
179- None
180- ) ) ;
171+ assert ! ( get_statement_for_completions( & doc, position) . is_none( ) ) ;
181172 }
182173
183174 #[ test]
@@ -186,9 +177,6 @@ mod tests {
186177
187178 let ( doc, position) = get_doc_and_pos ( sql. as_str ( ) ) ;
188179
189- assert ! ( matches!(
190- get_statement_for_completions( & doc, position) ,
191- None
192- ) ) ;
180+ assert ! ( get_statement_for_completions( & doc, position) . is_none( ) ) ;
193181 }
194182}
0 commit comments