File tree 1 file changed +5
-10
lines changed
crates/ide-assists/src/handlers
1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -129,16 +129,12 @@ fn replace_usages(
129
129
let pats = name
130
130
. syntax ( )
131
131
. ancestors ( )
132
- . nth ( 5 )
133
- . and_then ( node_to_pats)
134
- . or_else ( || {
135
- cov_mark:: hit!( replace_method_usage) ;
136
-
137
- name. syntax ( )
138
- . parent ( )
139
- . filter ( |node| ast:: MethodCallExpr :: can_cast ( node. kind ( ) ) )
140
- . and_then ( |node| node. parent ( ) . and_then ( node_to_pats) )
132
+ . find ( |node| {
133
+ ast:: CallExpr :: can_cast ( node. kind ( ) )
134
+ || ast:: MethodCallExpr :: can_cast ( node. kind ( ) )
141
135
} )
136
+ . and_then ( |node| node. parent ( ) )
137
+ . and_then ( node_to_pats)
142
138
. unwrap_or ( Vec :: new ( ) ) ;
143
139
144
140
let tuple_pats = pats. iter ( ) . filter_map ( |pat| match pat {
@@ -387,7 +383,6 @@ fn main() {
387
383
388
384
#[ test]
389
385
fn method_usage ( ) {
390
- cov_mark:: check!( replace_method_usage) ;
391
386
check_assist (
392
387
convert_tuple_return_type_to_struct,
393
388
r#"
You can’t perform that action at this time.
0 commit comments