File tree 1 file changed +0
-4
lines changed
1 file changed +0
-4
lines changed Original file line number Diff line number Diff line change @@ -1129,8 +1129,6 @@ impl String {
1129
1129
#[ inline]
1130
1130
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1131
1131
pub fn insert ( & mut self , idx : usize , ch : char ) {
1132
- let len = self . len ( ) ;
1133
- assert ! ( idx <= len) ;
1134
1132
assert ! ( self . is_char_boundary( idx) ) ;
1135
1133
let mut bits = [ 0 ; 4 ] ;
1136
1134
let bits = ch. encode_utf8 ( & mut bits) . as_bytes ( ) ;
@@ -1184,7 +1182,6 @@ impl String {
1184
1182
reason = "recent addition" ,
1185
1183
issue = "35553" ) ]
1186
1184
pub fn insert_str ( & mut self , idx : usize , string : & str ) {
1187
- assert ! ( idx <= self . len( ) ) ;
1188
1185
assert ! ( self . is_char_boundary( idx) ) ;
1189
1186
1190
1187
unsafe {
@@ -1288,7 +1285,6 @@ impl String {
1288
1285
#[ unstable( feature = "string_split_off" , issue = "38080" ) ]
1289
1286
pub fn split_off ( & mut self , mid : usize ) -> String {
1290
1287
assert ! ( self . is_char_boundary( mid) ) ;
1291
- assert ! ( mid <= self . len( ) ) ;
1292
1288
let other = self . vec . split_off ( mid) ;
1293
1289
unsafe { String :: from_utf8_unchecked ( other) }
1294
1290
}
You can’t perform that action at this time.
0 commit comments