From ba02a55330d2ec9a0ea2c5cd457b82782ae299e9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 28 Aug 2018 22:58:02 +0300 Subject: simplify --- crates/libsyntax2/src/yellow/syntax_text.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'crates/libsyntax2/src/yellow') diff --git a/crates/libsyntax2/src/yellow/syntax_text.rs b/crates/libsyntax2/src/yellow/syntax_text.rs index d299fd700..b855687c4 100644 --- a/crates/libsyntax2/src/yellow/syntax_text.rs +++ b/crates/libsyntax2/src/yellow/syntax_text.rs @@ -31,6 +31,9 @@ impl<'a> SyntaxText<'a> { Some(&text[range]) }) } + pub fn push_to(&self, buf: &mut String) { + self.chunks().for_each(|it| buf.push_str(it)); + } pub fn to_string(&self) -> String { self.chunks().collect() } -- cgit v1.2.3