diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-01-07 17:26:58 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-01-07 17:26:58 -0800 |
| commit | 6e806bdefde91af102567ef4b5dbd3ccf0c5c2ec (patch) | |
| tree | b8627ad2c80976f618b661ec14695f6a322ad1b3 /src/libfmt_macros | |
| parent | f6a7dc5528a9a9ac36867bbca2a6044b7be5bce2 (diff) | |
| parent | 7d72719efc25c6cdb8963c187e93df646ba65245 (diff) | |
| download | rust-6e806bdefde91af102567ef4b5dbd3ccf0c5c2ec.tar.gz rust-6e806bdefde91af102567ef4b5dbd3ccf0c5c2ec.zip | |
rollup merge of #20721: japaric/snap
Conflicts: src/libcollections/vec.rs src/libcore/fmt/mod.rs src/librustc/lint/builtin.rs src/librustc/session/config.rs src/librustc_trans/trans/base.rs src/librustc_trans/trans/context.rs src/librustc_trans/trans/type_.rs src/librustc_typeck/check/_match.rs src/librustdoc/html/format.rs src/libsyntax/std_inject.rs src/libsyntax/util/interner.rs src/test/compile-fail/mut-pattern-mismatched.rs
Diffstat (limited to 'src/libfmt_macros')
| -rw-r--r-- | src/libfmt_macros/lib.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libfmt_macros/lib.rs b/src/libfmt_macros/lib.rs index a703bfbb8fe..02eea5d024c 100644 --- a/src/libfmt_macros/lib.rs +++ b/src/libfmt_macros/lib.rs @@ -212,12 +212,12 @@ impl<'a> Parser<'a> { self.cur.next(); } Some((_, other)) => { - self.err(format!("expected `{:?}`, found `{:?}`", c, - other).index(&FullRange)); + self.err(&format!("expected `{:?}`, found `{:?}`", c, + other)[]); } None => { - self.err(format!("expected `{:?}` but string was terminated", - c).index(&FullRange)); + self.err(&format!("expected `{:?}` but string was terminated", + c)[]); } } } @@ -240,12 +240,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.index(&(start..pos)); + return &self.input[start..pos]; } Some(..) => { self.cur.next(); } None => { self.cur.next(); - return self.input.index(&(start..self.input.len())); + return &self.input[start..self.input.len()]; } } } @@ -285,7 +285,7 @@ impl<'a> Parser<'a> { flags: 0, precision: CountImplied, width: CountImplied, - ty: self.input.index(&(0..0)), + ty: &self.input[0..0], }; if !self.consume(':') { return spec } @@ -394,7 +394,7 @@ impl<'a> Parser<'a> { self.cur.next(); pos } - Some(..) | None => { return self.input.index(&(0..0)); } + Some(..) | None => { return &self.input[0..0]; } }; let mut end; loop { @@ -406,7 +406,7 @@ impl<'a> Parser<'a> { None => { end = self.input.len(); break } } } - self.input.index(&(start..end)) + &self.input[start..end] } /// Optionally parses an integer at the current position. This doesn't deal |
