File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -613,7 +613,8 @@ impl String {
613613 ///
614614 /// # Failure
615615 ///
616- /// Fails if `len` > current length.
616+ /// Fails if `new_len` > current length,
617+ /// or if `new_len` is not a character boundary.
617618 ///
618619 /// # Example
619620 ///
@@ -624,9 +625,9 @@ impl String {
624625 /// ```
625626 #[ inline]
626627 #[ unstable = "the failure conventions for strings are under development" ]
627- pub fn truncate ( & mut self , len : uint ) {
628- assert ! ( self . as_slice( ) . is_char_boundary( len ) ) ;
629- self . vec . truncate ( len )
628+ pub fn truncate ( & mut self , new_len : uint ) {
629+ assert ! ( self . as_slice( ) . is_char_boundary( new_len ) ) ;
630+ self . vec . truncate ( new_len )
630631 }
631632
632633 /// Appends a byte to this string buffer.
You can’t perform that action at this time.
0 commit comments