diff options
author | Aleksey Kladov <[email protected]> | 2018-08-28 19:45:59 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-28 19:45:59 +0100 |
commit | e6ab53619b329f0b68417cb9fab41086cd8f0174 (patch) | |
tree | 2c433ff42337816489fdfdb834e463a3d1fd6cdb /crates/libsyntax2/src/yellow | |
parent | f5de8212dac608f143a5697187e62336a95a1ab7 (diff) |
be more careful with adding semis
Diffstat (limited to 'crates/libsyntax2/src/yellow')
-rw-r--r-- | crates/libsyntax2/src/yellow/syntax_text.rs | 6 |
1 files changed, 6 insertions, 0 deletions
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<TextUnit> { | |||
99 | Some(TextRange::from_to(self.start, range.end())) | 99 | Some(TextRange::from_to(self.start, range.end())) |
100 | } | 100 | } |
101 | } | 101 | } |
102 | |||
103 | impl SyntaxTextSlice for ops::Range<TextUnit> { | ||
104 | fn restrict(&self, range: TextRange) -> Option<TextRange> { | ||
105 | TextRange::from_to(self.start, self.end).restrict(range) | ||
106 | } | ||
107 | } | ||