diff options
| author | bors <bors@rust-lang.org> | 2014-10-05 21:07:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-10-05 21:07:10 +0000 |
| commit | 9978dc87aa49760cb515f4e57f141ae9b82d3576 (patch) | |
| tree | 9038ad1435690f0acf8e70fd61cea3fd8f7a3eab /src | |
| parent | f56c1c91f39b25aaa6453359c0a1da9269d5238f (diff) | |
| parent | 80401da12e47c6b3cce0e9921980ec49b1b03a10 (diff) | |
| download | rust-9978dc87aa49760cb515f4e57f141ae9b82d3576.tar.gz rust-9978dc87aa49760cb515f4e57f141ae9b82d3576.zip | |
auto merge of #17794 : SimonSapin/rust/patch-8, r=alexcrichton
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcollections/string.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 2cc225f50bc..43fcdfae4d6 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -613,7 +613,8 @@ impl String { /// /// # Failure /// - /// Fails if `len` > current length. + /// Fails if `new_len` > current length, + /// or if `new_len` is not a character boundary. /// /// # Example /// @@ -624,9 +625,9 @@ impl String { /// ``` #[inline] #[unstable = "the failure conventions for strings are under development"] - pub fn truncate(&mut self, len: uint) { - assert!(self.as_slice().is_char_boundary(len)); - self.vec.truncate(len) + pub fn truncate(&mut self, new_len: uint) { + assert!(self.as_slice().is_char_boundary(new_len)); + self.vec.truncate(new_len) } /// Appends a byte to this string buffer. |
