about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrik Sverdrup <bluss@users.noreply.github.com>2015-07-04 15:20:34 +0200
committerUlrik Sverdrup <bluss@users.noreply.github.com>2015-07-04 15:20:34 +0200
commitc5a0a73253dd5cbd1bde8b05b15b3e644ad2b37a (patch)
treeb2f953fda966764a868686426b83672eb4628e45
parent0da69969d1fc8d375867ff07dfcefa2c4a2e7724 (diff)
downloadrust-c5a0a73253dd5cbd1bde8b05b15b3e644ad2b37a.tar.gz
rust-c5a0a73253dd5cbd1bde8b05b15b3e644ad2b37a.zip
str: Correct documentation on is_char_boundary
Documentation claims it panics on out of bounds -- it regards out of
bounds as just not a char boundary.

core::str module is aware of how it works and uses it appropriately.
Maybe we should rename it to `is_valid_index`, `is_slicable_index`, or
something similar.
-rw-r--r--src/libcollections/str.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs
index 6be46855fe6..7e72ad1569a 100644
--- a/src/libcollections/str.rs
+++ b/src/libcollections/str.rs
@@ -483,9 +483,7 @@ impl str {
     /// considered to be
     /// boundaries.
     ///
-    /// # Panics
-    ///
-    /// Panics if `index` is greater than `self.len()`.
+    /// Returns `false` if `index` is greater than `self.len()`.
     ///
     /// # Examples
     ///