about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2015-01-12 16:59:18 -0500
committerJorge Aparicio <japaricious@gmail.com>2015-01-12 17:59:37 -0500
commitc1d48a85082cfe3683ad9eda5223d3259d4fa718 (patch)
treeac65328b877bd7a2127dbd4d0edaf7b637f0878e /src/libsyntax
parent3a44a19af29585c02e81e22ea7665f829ae0590a (diff)
downloadrust-c1d48a85082cfe3683ad9eda5223d3259d4fa718.tar.gz
rust-c1d48a85082cfe3683ad9eda5223d3259d4fa718.zip
cleanup: `&foo[0..a]` -> `&foo[..a]`
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast_map/mod.rs2
-rw-r--r--src/libsyntax/codemap.rs2
-rw-r--r--src/libsyntax/diagnostic.rs2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/ast_map/mod.rs b/src/libsyntax/ast_map/mod.rs
index 3ef57279175..d4fc5f2dd1a 100644
--- a/src/libsyntax/ast_map/mod.rs
+++ b/src/libsyntax/ast_map/mod.rs
@@ -513,7 +513,7 @@ impl<'ast> Map<'ast> {
         NodesMatchingSuffix {
             map: self,
             item_name: parts.last().unwrap(),
-            in_which: &parts[0..(parts.len() - 1)],
+            in_which: &parts[..(parts.len() - 1)],
             idx: 0,
         }
     }
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs
index 9a422e17bb4..bf26687deed 100644
--- a/src/libsyntax/codemap.rs
+++ b/src/libsyntax/codemap.rs
@@ -313,7 +313,7 @@ impl FileMap {
             let begin = begin.to_uint();
             let slice = &self.src[begin..];
             match slice.find('\n') {
-                Some(e) => &slice[0..e],
+                Some(e) => &slice[..e],
                 None => slice
             }.to_string()
         })
diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs
index 3f81dac2b0d..dfef5287260 100644
--- a/src/libsyntax/diagnostic.rs
+++ b/src/libsyntax/diagnostic.rs
@@ -277,7 +277,7 @@ fn print_maybe_styled(w: &mut EmitterWriter,
             // to be miscolored. We assume this is rare enough that we don't
             // have to worry about it.
             if msg.ends_with("\n") {
-                try!(t.write_str(&msg[0..(msg.len()-1)]));
+                try!(t.write_str(&msg[..(msg.len()-1)]));
                 try!(t.reset());
                 try!(t.write_str("\n"));
             } else {