File tree Expand file tree Collapse file tree 1 file changed +0
-4
lines changed Expand file tree Collapse file tree 1 file changed +0
-4
lines changed Original file line number Diff line number Diff line change @@ -1129,8 +1129,6 @@ impl String {
11291129 #[ inline]
11301130 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
11311131 pub fn insert ( & mut self , idx : usize , ch : char ) {
1132- let len = self . len ( ) ;
1133- assert ! ( idx <= len) ;
11341132 assert ! ( self . is_char_boundary( idx) ) ;
11351133 let mut bits = [ 0 ; 4 ] ;
11361134 let bits = ch. encode_utf8 ( & mut bits) . as_bytes ( ) ;
@@ -1184,7 +1182,6 @@ impl String {
11841182 reason = "recent addition" ,
11851183 issue = "35553" ) ]
11861184 pub fn insert_str ( & mut self , idx : usize , string : & str ) {
1187- assert ! ( idx <= self . len( ) ) ;
11881185 assert ! ( self . is_char_boundary( idx) ) ;
11891186
11901187 unsafe {
@@ -1288,7 +1285,6 @@ impl String {
12881285 #[ unstable( feature = "string_split_off" , issue = "38080" ) ]
12891286 pub fn split_off ( & mut self , mid : usize ) -> String {
12901287 assert ! ( self . is_char_boundary( mid) ) ;
1291- assert ! ( mid <= self . len( ) ) ;
12921288 let other = self . vec . split_off ( mid) ;
12931289 unsafe { String :: from_utf8_unchecked ( other) }
12941290 }
You can’t perform that action at this time.
0 commit comments