We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dfbe9eb commit 80401daCopy full SHA for 80401da
src/libcollections/string.rs
@@ -613,7 +613,8 @@ impl String {
613
///
614
/// # Failure
615
616
- /// Fails if `len` > current length.
+ /// Fails if `new_len` > current length,
617
+ /// or if `new_len` is not a character boundary.
618
619
/// # Example
620
@@ -624,9 +625,9 @@ impl String {
624
625
/// ```
626
#[inline]
627
#[unstable = "the failure conventions for strings are under development"]
- pub fn truncate(&mut self, len: uint) {
628
- assert!(self.as_slice().is_char_boundary(len));
629
- self.vec.truncate(len)
+ pub fn truncate(&mut self, new_len: uint) {
+ assert!(self.as_slice().is_char_boundary(new_len));
630
+ self.vec.truncate(new_len)
631
}
632
633
/// Appends a byte to this string buffer.
0 commit comments