Skip to content

Commit

Permalink
auto merge of #17794 : SimonSapin/rust/patch-8, r=alexcrichton
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Oct 5, 2014
2 parents f56c1c9 + 80401da commit 9978dc8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/libcollections/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand All @@ -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.
Expand Down

0 comments on commit 9978dc8

Please sign in to comment.