From d39c3f7b3ec95cb3cc1e579d7d747206c66aab74 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 21 Feb 2017 20:27:43 -0800 Subject: Relax assertions in substr_offset slightly Closes #152 --- src/tokens.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/tokens.rs b/src/tokens.rs index 26c8277..ec7bb08 100644 --- a/src/tokens.rs +++ b/src/tokens.rs @@ -380,7 +380,7 @@ impl<'a> Tokenizer<'a> { } pub fn substr_offset(&self, s: &'a str) -> usize { - assert!(s.len() < self.input.len()); + assert!(s.len() <= self.input.len()); let a = self.input.as_ptr() as usize; let b = s.as_ptr() as usize; assert!(a <= b); -- cgit v1.2.3