diff options
author | Aleksey Kladov <[email protected]> | 2021-05-08 12:38:56 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-05-08 12:47:14 +0100 |
commit | 1fdc9d8e9ee6afa62fe312e18aadaff316265bb8 (patch) | |
tree | 8c8a73cee1b7333920f2b13fe7899f35b9bb1b91 /crates/syntax/src | |
parent | 4e3f0186d87e1be85bdc1e0bc3074147715e46c3 (diff) |
internal: remove one more syntax rewriter
Diffstat (limited to 'crates/syntax/src')
-rw-r--r-- | crates/syntax/src/ted.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/syntax/src/ted.rs b/crates/syntax/src/ted.rs index 91a06101f..a50c0dbca 100644 --- a/crates/syntax/src/ted.rs +++ b/crates/syntax/src/ted.rs | |||
@@ -125,8 +125,11 @@ pub fn remove_all_iter(range: impl IntoIterator<Item = SyntaxElement>) { | |||
125 | } | 125 | } |
126 | 126 | ||
127 | pub fn replace(old: impl Element, new: impl Element) { | 127 | pub fn replace(old: impl Element, new: impl Element) { |
128 | replace_with_many(old, vec![new.syntax_element()]) | ||
129 | } | ||
130 | pub fn replace_with_many(old: impl Element, new: Vec<SyntaxElement>) { | ||
128 | let old = old.syntax_element(); | 131 | let old = old.syntax_element(); |
129 | replace_all(old.clone()..=old, vec![new.syntax_element()]) | 132 | replace_all(old.clone()..=old, new) |
130 | } | 133 | } |
131 | pub fn replace_all(range: RangeInclusive<SyntaxElement>, new: Vec<SyntaxElement>) { | 134 | pub fn replace_all(range: RangeInclusive<SyntaxElement>, new: Vec<SyntaxElement>) { |
132 | let start = range.start().index(); | 135 | let start = range.start().index(); |