diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-02-18 15:48:40 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-02-18 15:48:40 -0800 |
| commit | 231eeaa35b3a7700cfd05dcb30f01cd7a36313b8 (patch) | |
| tree | 83644afe1c67870e2f015abfc834307aa532dec7 /src/libcollections/string.rs | |
| parent | 2cdbd288ac0606902885434e1ccd8d8bde68913d (diff) | |
| parent | 9ea84aeed4ed3006eddb6a7b24e9714f2844cd22 (diff) | |
| download | rust-231eeaa35b3a7700cfd05dcb30f01cd7a36313b8.tar.gz rust-231eeaa35b3a7700cfd05dcb30f01cd7a36313b8.zip | |
rollup merge of #22502: nikomatsakis/deprecate-bracket-bracket
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/librustc/middle/lang_items.rs src/librustc_back/rpath.rs src/librustc_typeck/check/regionck.rs src/libstd/ffi/os_str.rs src/libsyntax/diagnostic.rs src/libsyntax/parse/parser.rs src/libsyntax/util/interner.rs src/test/run-pass/regions-refcell.rs
Diffstat (limited to 'src/libcollections/string.rs')
| -rw-r--r-- | src/libcollections/string.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 5e48336dfad..3b179d0b94c 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -868,7 +868,7 @@ impl ops::Index<ops::Range<usize>> for String { type Output = str; #[inline] fn index(&self, index: &ops::Range<usize>) -> &str { - &self[][*index] + &self[..][*index] } } #[stable(feature = "rust1", since = "1.0.0")] @@ -876,7 +876,7 @@ impl ops::Index<ops::RangeTo<usize>> for String { type Output = str; #[inline] fn index(&self, index: &ops::RangeTo<usize>) -> &str { - &self[][*index] + &self[..][*index] } } #[stable(feature = "rust1", since = "1.0.0")] @@ -884,7 +884,7 @@ impl ops::Index<ops::RangeFrom<usize>> for String { type Output = str; #[inline] fn index(&self, index: &ops::RangeFrom<usize>) -> &str { - &self[][*index] + &self[..][*index] } } #[stable(feature = "rust1", since = "1.0.0")] @@ -902,7 +902,7 @@ impl ops::Deref for String { #[inline] fn deref(&self) -> &str { - unsafe { mem::transmute(&self.vec[]) } + unsafe { mem::transmute(&self.vec[..]) } } } @@ -1301,7 +1301,7 @@ mod tests { #[test] fn test_slicing() { let s = "foobar".to_string(); - assert_eq!("foobar", &s[]); + assert_eq!("foobar", &s[..]); assert_eq!("foo", &s[..3]); assert_eq!("bar", &s[3..]); assert_eq!("oob", &s[1..4]); |
