aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/raw_string.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/raw_string.rs')
-rw-r--r--crates/ra_assists/src/raw_string.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_assists/src/raw_string.rs b/crates/ra_assists/src/raw_string.rs
index 867f09f28..1cb4297a9 100644
--- a/crates/ra_assists/src/raw_string.rs
+++ b/crates/ra_assists/src/raw_string.rs
@@ -47,7 +47,7 @@ pub(crate) fn make_usual_string(mut ctx: AssistCtx<impl HirDatabase>) -> Option<
47 let start_of_inside = usual_start_pos + TextUnit::from(1); 47 let start_of_inside = usual_start_pos + TextUnit::from(1);
48 let end_of_inside = text.len() - usual_start_pos - TextUnit::from(1); 48 let end_of_inside = text.len() - usual_start_pos - TextUnit::from(1);
49 let inside_str = text.slice(TextRange::from_to(start_of_inside, end_of_inside)); 49 let inside_str = text.slice(TextRange::from_to(start_of_inside, end_of_inside));
50 escape_quote( 50 escape_double_quote(
51 edit, 51 edit,
52 &inside_str, 52 &inside_str,
53 literal.syntax().text_range().start() + start_of_inside, 53 literal.syntax().text_range().start() + start_of_inside,
@@ -73,7 +73,7 @@ pub(crate) fn add_hash(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> {
73 } 73 }
74} 74}
75 75
76fn escape_quote(edit: &mut AssistBuilder, inside_str: &SyntaxText, offset: TextUnit) { 76fn escape_double_quote(edit: &mut AssistBuilder, inside_str: &SyntaxText, offset: TextUnit) {
77 let mut start = TextUnit::from(0); 77 let mut start = TextUnit::from(0);
78 inside_str.for_each_chunk(|chunk| { 78 inside_str.for_each_chunk(|chunk| {
79 let end = start + TextUnit::of_str(chunk); 79 let end = start + TextUnit::of_str(chunk);
@@ -109,7 +109,7 @@ pub(crate) fn remove_hash(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist
109 // no more hash after assist, need to escape any `"` in the string 109 // no more hash after assist, need to escape any `"` in the string
110 let inside_str = text 110 let inside_str = text
111 .slice(TextRange::from_to(TextUnit::from(3), text.len() - TextUnit::from(2))); 111 .slice(TextRange::from_to(TextUnit::from(3), text.len() - TextUnit::from(2)));
112 escape_quote( 112 escape_double_quote(
113 edit, 113 edit,
114 &inside_str, 114 &inside_str,
115 literal.syntax().text_range().start() + TextUnit::from(3), 115 literal.syntax().text_range().start() + TextUnit::from(3),