about summary refs log tree commit diff
path: root/src/libcore/str
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/libcore/str
parent3a44a19af29585c02e81e22ea7665f829ae0590a (diff)
downloadrust-c1d48a85082cfe3683ad9eda5223d3259d4fa718.tar.gz
rust-c1d48a85082cfe3683ad9eda5223d3259d4fa718.zip
cleanup: `&foo[0..a]` -> `&foo[..a]`
Diffstat (limited to 'src/libcore/str')
-rw-r--r--src/libcore/str/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs
index 94ee9b7dcf6..d9cf6dc086d 100644
--- a/src/libcore/str/mod.rs
+++ b/src/libcore/str/mod.rs
@@ -701,10 +701,10 @@ impl TwoWaySearcher {
         //
         // What's going on is we have some critical factorization (u, v) of the
         // needle, and we want to determine whether u is a suffix of
-        // &v[0..period]. If it is, we use "Algorithm CP1". Otherwise we use
+        // &v[..period]. If it is, we use "Algorithm CP1". Otherwise we use
         // "Algorithm CP2", which is optimized for when the period of the needle
         // is large.
-        if &needle[0..crit_pos] == &needle[period.. period + crit_pos] {
+        if &needle[..crit_pos] == &needle[period.. period + crit_pos] {
             TwoWaySearcher {
                 crit_pos: crit_pos,
                 period: period,
@@ -1412,7 +1412,7 @@ impl StrExt for str {
     #[inline]
     fn starts_with(&self, needle: &str) -> bool {
         let n = needle.len();
-        self.len() >= n && needle.as_bytes() == &self.as_bytes()[0..n]
+        self.len() >= n && needle.as_bytes() == &self.as_bytes()[..n]
     }
 
     #[inline]