about summary refs log tree commit diff
path: root/src/liballoc/string.rs
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-07-22 22:10:09 +0800
committerGitHub <noreply@github.com>2018-07-22 22:10:09 +0800
commit67cf3ba528ac99dbec7753f81ed93eccd1a5a730 (patch)
tree779545a0a1f604f3aa04c381ce16d0807df57e2f /src/liballoc/string.rs
parentd3b3bc57670ab91a53b2100cf3dfe78947bfe077 (diff)
parent808bcfbe53cec7aa6d728148fc2fcb3a4c951009 (diff)
downloadrust-67cf3ba528ac99dbec7753f81ed93eccd1a5a730.tar.gz
rust-67cf3ba528ac99dbec7753f81ed93eccd1a5a730.zip
Rollup merge of #51807 - newpavlov:deprecate_str_slice, r=alexcrichton
Deprecation of str::slice_unchecked(_mut)

Closes #51715

I am not sure if 1.28.0 or 1.29.0 should be used for deprecation version, for now it's 1.28.0.

Additionally I've replaced `slice_unchecked` uses with `get_unchecked`. The only places where this method is still used are `src/liballoc/tests/str.rs` and `src/liballoc/tests/str.rs`.
Diffstat (limited to 'src/liballoc/string.rs')
-rw-r--r--src/liballoc/string.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs
index 6b28687a060..631779a17a1 100644
--- a/src/liballoc/string.rs
+++ b/src/liballoc/string.rs
@@ -1222,7 +1222,7 @@ impl String {
 
         while idx < len {
             let ch = unsafe {
-                self.slice_unchecked(idx, len).chars().next().unwrap()
+                self.get_unchecked(idx..len).chars().next().unwrap()
             };
             let ch_len = ch.len_utf8();