Skip to content

Commit 9ecd82b

Browse files
committed
Remove rename_self_outside_of_methods
1 parent 4b32a49 commit 9ecd82b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

crates/ide/src/rename.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -473,12 +473,7 @@ fn text_edit_from_self_param(self_param: &ast::SelfParam, new_name: String) -> O
473473
replacement_text.push_str("mut ");
474474
}
475475

476-
if self_param.syntax().ancestors().find_map(ast::Impl::cast).is_some() {
477-
replacement_text.push_str("Self");
478-
} else {
479-
cov_mark::hit!(rename_self_outside_of_methods);
480-
replacement_text.push('_');
481-
}
476+
replacement_text.push_str("Self");
482477

483478
Some(TextEdit::replace(self_param.syntax().text_range(), replacement_text))
484479
}
@@ -2124,7 +2119,6 @@ impl<'a> Foo<'a> {
21242119

21252120
#[test]
21262121
fn test_self_outside_of_methods() {
2127-
cov_mark::check!(rename_self_outside_of_methods);
21282122
check(
21292123
"foo",
21302124
r#"
@@ -2133,7 +2127,7 @@ fn f($0self) -> i32 {
21332127
}
21342128
"#,
21352129
r#"
2136-
fn f(foo: _) -> i32 {
2130+
fn f(foo: Self) -> i32 {
21372131
foo.i
21382132
}
21392133
"#,

0 commit comments

Comments
 (0)