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 {
613
613
///
614
614
/// # Failure
615
615
///
616
- /// Fails if `len` > current length.
616
+ /// Fails if `new_len` > current length,
617
+ /// or if `new_len` is not a character boundary.
617
618
///
618
619
/// # Example
619
620
///
@@ -624,9 +625,9 @@ impl String {
624
625
/// ```
625
626
#[ inline]
626
627
#[ 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 )
630
631
}
631
632
632
633
/// Appends a byte to this string buffer.
You can’t perform that action at this time.
0 commit comments