aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/change_visibility.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/change_visibility.rs')
-rw-r--r--crates/ra_assists/src/change_visibility.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_assists/src/change_visibility.rs b/crates/ra_assists/src/change_visibility.rs
index d28cdd07b..60c74debc 100644
--- a/crates/ra_assists/src/change_visibility.rs
+++ b/crates/ra_assists/src/change_visibility.rs
@@ -38,7 +38,7 @@ fn add_vis(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> {
38 (vis_offset(&parent), keyword.text_range()) 38 (vis_offset(&parent), keyword.text_range())
39 } else { 39 } else {
40 let ident = ctx.token_at_offset().find(|leaf| leaf.kind() == IDENT)?; 40 let ident = ctx.token_at_offset().find(|leaf| leaf.kind() == IDENT)?;
41 let field = ident.parent().ancestors().find_map(ast::NamedFieldDef::cast)?; 41 let field = ident.parent().ancestors().find_map(ast::RecordFieldDef::cast)?;
42 if field.name()?.syntax().text_range() != ident.text_range() && field.visibility().is_some() 42 if field.name()?.syntax().text_range() != ident.text_range() && field.visibility().is_some()
43 { 43 {
44 return None; 44 return None;