diff options
author | Igor Aleksanov <[email protected]> | 2020-08-12 15:26:43 +0100 |
---|---|---|
committer | Igor Aleksanov <[email protected]> | 2020-08-12 15:26:43 +0100 |
commit | b50bb800a5b5e01b6cb4de10330fd5b61d6cd0db (patch) | |
tree | adb19b05996e8a2829f5a6eb0ed7017404aaf7da /crates/ra_text_edit/src | |
parent | 13f736d4a13bdf5af2cdd6a4832a41470431a70b (diff) | |
parent | 6be5ab02008b442c85c201968b97f24f13c4692e (diff) |
Merge branch 'master' into add-disable-diagnostics
Diffstat (limited to 'crates/ra_text_edit/src')
-rw-r--r-- | crates/ra_text_edit/src/lib.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/crates/ra_text_edit/src/lib.rs b/crates/ra_text_edit/src/lib.rs index 25554f583..d68791cf1 100644 --- a/crates/ra_text_edit/src/lib.rs +++ b/crates/ra_text_edit/src/lib.rs | |||
@@ -76,10 +76,6 @@ impl TextEdit { | |||
76 | self.indels.iter() | 76 | self.indels.iter() |
77 | } | 77 | } |
78 | 78 | ||
79 | pub fn into_iter(self) -> vec::IntoIter<Indel> { | ||
80 | self.indels.into_iter() | ||
81 | } | ||
82 | |||
83 | pub fn apply(&self, text: &mut String) { | 79 | pub fn apply(&self, text: &mut String) { |
84 | match self.len() { | 80 | match self.len() { |
85 | 0 => return, | 81 | 0 => return, |
@@ -141,6 +137,15 @@ impl TextEdit { | |||
141 | } | 137 | } |
142 | } | 138 | } |
143 | 139 | ||
140 | impl IntoIterator for TextEdit { | ||
141 | type Item = Indel; | ||
142 | type IntoIter = vec::IntoIter<Self::Item>; | ||
143 | |||
144 | fn into_iter(self) -> Self::IntoIter { | ||
145 | self.indels.into_iter() | ||
146 | } | ||
147 | } | ||
148 | |||
144 | impl TextEditBuilder { | 149 | impl TextEditBuilder { |
145 | pub fn replace(&mut self, range: TextRange, replace_with: String) { | 150 | pub fn replace(&mut self, range: TextRange, replace_with: String) { |
146 | self.indels.push(Indel::replace(range, replace_with)) | 151 | self.indels.push(Indel::replace(range, replace_with)) |