]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #35598 - tshepang:needless-binding, r=steveklabnik
authorEduard-Mihai Burtescu <edy.burt@gmail.com>
Sun, 14 Aug 2016 17:29:50 +0000 (20:29 +0300)
committerGitHub <noreply@github.com>
Sun, 14 Aug 2016 17:29:50 +0000 (20:29 +0300)
string: remove needless binding

src/libcollections/string.rs

index cbbc0ba77947a2fb3a8b46eeec93019ffe4b2c0a..788c838cd3fc8ddaf70ec34a6d862bdac2d2a591 100644 (file)
@@ -1182,8 +1182,7 @@ unsafe fn insert_bytes(&mut self, idx: usize, bytes: &[u8]) {
                reason = "recent addition",
                issue = "35553")]
     pub fn insert_str(&mut self, idx: usize, string: &str) {
-        let len = self.len();
-        assert!(idx <= len);
+        assert!(idx <= self.len());
         assert!(self.is_char_boundary(idx));
 
         unsafe {