From 0343c4a815a0e82d5e55e76a01d21b0f7a00ff5b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 19 Jul 2019 11:24:41 +0300 Subject: migrate ra_assists to the new AST --- crates/ra_assists/src/change_visibility.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_assists/src/change_visibility.rs') diff --git a/crates/ra_assists/src/change_visibility.rs b/crates/ra_assists/src/change_visibility.rs index 6cabba3e3..ab10d2aa4 100644 --- a/crates/ra_assists/src/change_visibility.rs +++ b/crates/ra_assists/src/change_visibility.rs @@ -35,7 +35,7 @@ fn add_vis(mut ctx: AssistCtx) -> Option { if parent.children().any(|child| child.kind() == VISIBILITY) { return None; } - (vis_offset(parent), keyword.range()) + (vis_offset(&parent), keyword.range()) } else { let ident = ctx.token_at_offset().find(|leaf| leaf.kind() == IDENT)?; let field = ident.parent().ancestors().find_map(ast::NamedFieldDef::cast)?; @@ -65,7 +65,7 @@ fn vis_offset(node: &SyntaxNode) -> TextUnit { .unwrap_or_else(|| node.range().start()) } -fn change_vis(mut ctx: AssistCtx, vis: &ast::Visibility) -> Option { +fn change_vis(mut ctx: AssistCtx, vis: ast::Visibility) -> Option { if vis.syntax().text() == "pub" { ctx.add_action(AssistId("change_visibility"), "change to pub(crate)", |edit| { edit.target(vis.syntax().range()); -- cgit v1.2.3