auto merge of #17794 : SimonSapin/rust/patch-8, r=alexcrichton

This commit is contained in:
bors 2014-10-05 21:07:10 +00:00
commit 9978dc87aa
1 changed files with 5 additions and 4 deletions

View File

@ -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.