about summary refs log tree commit diff
path: root/library/alloc/src/string.rs
diff options
context:
space:
mode:
authordylni <46035563+dylni@users.noreply.github.com>2020-09-18 13:55:03 -0400
committerdylni <46035563+dylni@users.noreply.github.com>2020-09-18 13:55:03 -0400
commitf055b0bb0847ecf08fe452a270faae8324b55b05 (patch)
treed280ee7158a689b69729863dd4c2bec24d27a5a5 /library/alloc/src/string.rs
parenteb63168e007058dad4af758faf1dca449c049777 (diff)
downloadrust-f055b0bb0847ecf08fe452a270faae8324b55b05.tar.gz
rust-f055b0bb0847ecf08fe452a270faae8324b55b05.zip
Rename method to `assert_len`
Diffstat (limited to 'library/alloc/src/string.rs')
-rw-r--r--library/alloc/src/string.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs
index 26124e30111..7b0ec1c43c0 100644
--- a/library/alloc/src/string.rs
+++ b/library/alloc/src/string.rs
@@ -1506,14 +1506,14 @@ impl String {
         // of the vector version. The data is just plain bytes.
         // Because the range removal happens in Drop, if the Drain iterator is leaked,
         // the removal will not happen.
-        let Range { start, end } = range.for_length(self.len());
+        let Range { start, end } = range.assert_len(self.len());
         assert!(self.is_char_boundary(start));
         assert!(self.is_char_boundary(end));
 
         // Take out two simultaneous borrows. The &mut String won't be accessed
         // until iteration is over, in Drop.
         let self_ptr = self as *mut _;
-        // SAFETY: `for_length` and `is_char_boundary` do the appropriate bounds checks.
+        // SAFETY: `assert_len` and `is_char_boundary` do the appropriate bounds checks.
         let chars_iter = unsafe { self.get_unchecked(start..end) }.chars();
 
         Drain { start, end, iter: chars_iter, string: self_ptr }