Skip to content

Commit c21bbba

Browse files
authored
Rollup merge of rust-lang#35598 - tshepang:needless-binding, r=steveklabnik
string: remove needless binding
2 parents 4ab8208 + 071410b commit c21bbba

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/libcollections/string.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,8 +1182,7 @@ impl String {
11821182
reason = "recent addition",
11831183
issue = "35553")]
11841184
pub fn insert_str(&mut self, idx: usize, string: &str) {
1185-
let len = self.len();
1186-
assert!(idx <= len);
1185+
assert!(idx <= self.len());
11871186
assert!(self.is_char_boundary(idx));
11881187

11891188
unsafe {

0 commit comments

Comments
 (0)