diff options
Diffstat (limited to 'crates/ra_assists/src/flip_comma.rs')
-rw-r--r-- | crates/ra_assists/src/flip_comma.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_assists/src/flip_comma.rs b/crates/ra_assists/src/flip_comma.rs index d8dba779f..13016ae06 100644 --- a/crates/ra_assists/src/flip_comma.rs +++ b/crates/ra_assists/src/flip_comma.rs | |||
@@ -5,8 +5,8 @@ use crate::{Assist, AssistCtx, AssistId}; | |||
5 | 5 | ||
6 | pub(crate) fn flip_comma(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { | 6 | pub(crate) fn flip_comma(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { |
7 | let comma = ctx.token_at_offset().find(|leaf| leaf.kind() == T![,])?; | 7 | let comma = ctx.token_at_offset().find(|leaf| leaf.kind() == T![,])?; |
8 | let prev = non_trivia_sibling(comma.into(), Direction::Prev)?; | 8 | let prev = non_trivia_sibling(comma.clone().into(), Direction::Prev)?; |
9 | let next = non_trivia_sibling(comma.into(), Direction::Next)?; | 9 | let next = non_trivia_sibling(comma.clone().into(), Direction::Next)?; |
10 | ctx.add_action(AssistId("flip_comma"), "flip comma", |edit| { | 10 | ctx.add_action(AssistId("flip_comma"), "flip comma", |edit| { |
11 | edit.target(comma.range()); | 11 | edit.target(comma.range()); |
12 | edit.replace(prev.range(), next.to_string()); | 12 | edit.replace(prev.range(), next.to_string()); |