]> 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

1  2 
src/libcollections/string.rs

index cbbc0ba77947a2fb3a8b46eeec93019ffe4b2c0a,50716d03ac470493e269b38198ce1837d23f2d74..788c838cd3fc8ddaf70ec34a6d862bdac2d2a591
@@@ -1180,10 -1180,9 +1180,9 @@@ impl String 
      #[inline]
      #[unstable(feature = "insert_str",
                 reason = "recent addition",
 -               issue = "0")]
 +               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 {