From e6ab53619b329f0b68417cb9fab41086cd8f0174 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 28 Aug 2018 21:45:59 +0300 Subject: be more careful with adding semis --- crates/libsyntax2/src/yellow/syntax_text.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crates/libsyntax2/src') diff --git a/crates/libsyntax2/src/yellow/syntax_text.rs b/crates/libsyntax2/src/yellow/syntax_text.rs index 268547470..d299fd700 100644 --- a/crates/libsyntax2/src/yellow/syntax_text.rs +++ b/crates/libsyntax2/src/yellow/syntax_text.rs @@ -99,3 +99,9 @@ impl SyntaxTextSlice for ops::RangeFrom { Some(TextRange::from_to(self.start, range.end())) } } + +impl SyntaxTextSlice for ops::Range { + fn restrict(&self, range: TextRange) -> Option { + TextRange::from_to(self.start, self.end).restrict(range) + } +} -- cgit v1.2.3