diff options
Diffstat (limited to 'src/libfmt_macros/lib.rs')
| -rw-r--r-- | src/libfmt_macros/lib.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libfmt_macros/lib.rs b/src/libfmt_macros/lib.rs index 917c6e99992..3829d98c7a1 100644 --- a/src/libfmt_macros/lib.rs +++ b/src/libfmt_macros/lib.rs @@ -212,11 +212,11 @@ impl<'a> Parser<'a> { self.cur.next(); } Some((_, other)) => { - self.err(format!("expected `{}`, found `{}`", c, other)[]); + self.err(format!("expected `{}`, found `{}`", c, other).index(&FullRange)); } None => { self.err(format!("expected `{}` but string was terminated", - c)[]); + c).index(&FullRange)); } } } @@ -239,12 +239,12 @@ impl<'a> Parser<'a> { // we may not consume the character, so clone the iterator match self.cur.clone().next() { Some((pos, '}')) | Some((pos, '{')) => { - return self.input[start..pos]; + return self.input.index(&(start..pos)); } Some(..) => { self.cur.next(); } None => { self.cur.next(); - return self.input[start..self.input.len()]; + return self.input.index(&(start..self.input.len())); } } } @@ -284,7 +284,7 @@ impl<'a> Parser<'a> { flags: 0, precision: CountImplied, width: CountImplied, - ty: self.input[0..0], + ty: self.input.index(&(0..0)), }; if !self.consume(':') { return spec } @@ -393,7 +393,7 @@ impl<'a> Parser<'a> { self.cur.next(); pos } - Some(..) | None => { return self.input[0..0]; } + Some(..) | None => { return self.input.index(&(0..0)); } }; let mut end; loop { @@ -405,7 +405,7 @@ impl<'a> Parser<'a> { None => { end = self.input.len(); break } } } - self.input[start..end] + self.input.index(&(start..end)) } /// Optionally parses an integer at the current position. This doesn't deal |
