aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_text_edit/src/text_edit.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-03 16:08:52 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-03 16:08:52 +0000
commit33924c0939bb64cdb6fc4644582411a7be1f135d (patch)
treeea555719a2ec8574f5399de896b9c4e2586c7270 /crates/ra_text_edit/src/text_edit.rs
parent5443205fdd9f4886cc88ad15c3a6061ffa90ca19 (diff)
parent6be39ba758eade2a20ab6384127a2b1ca48ca9ce (diff)
Merge #416
416: assist-builder r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_text_edit/src/text_edit.rs')
-rw-r--r--crates/ra_text_edit/src/text_edit.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/crates/ra_text_edit/src/text_edit.rs b/crates/ra_text_edit/src/text_edit.rs
index 0881f3e1c..a288a990d 100644
--- a/crates/ra_text_edit/src/text_edit.rs
+++ b/crates/ra_text_edit/src/text_edit.rs
@@ -7,15 +7,12 @@ pub struct TextEdit {
7 atoms: Vec<AtomTextEdit>, 7 atoms: Vec<AtomTextEdit>,
8} 8}
9 9
10#[derive(Debug)] 10#[derive(Debug, Default)]
11pub struct TextEditBuilder { 11pub struct TextEditBuilder {
12 atoms: Vec<AtomTextEdit>, 12 atoms: Vec<AtomTextEdit>,
13} 13}
14 14
15impl TextEditBuilder { 15impl TextEditBuilder {
16 pub fn new() -> TextEditBuilder {
17 TextEditBuilder { atoms: Vec::new() }
18 }
19 pub fn replace(&mut self, range: TextRange, replace_with: String) { 16 pub fn replace(&mut self, range: TextRange, replace_with: String) {
20 self.atoms.push(AtomTextEdit::replace(range, replace_with)) 17 self.atoms.push(AtomTextEdit::replace(range, replace_with))
21 } 18 }