diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2020-04-15 15:15:31 +0200 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2020-04-15 23:38:48 +0200 |
| commit | 139c64625173edab849acd9fbcea9739bb2bb802 (patch) | |
| tree | 0c7e08f692321138c8cb0c7c12151255ea13b3d6 /src/liballoc/vec.rs | |
| parent | 835428c35d785733e72bfbf32fc2f8fff3e50e63 (diff) | |
| download | rust-139c64625173edab849acd9fbcea9739bb2bb802.tar.gz rust-139c64625173edab849acd9fbcea9739bb2bb802.zip | |
Fix clippy warnings
clippy::{filter_next,single_char_pattern,unit_arg,identity_conversion,nonminimal_bool}
Diffstat (limited to 'src/liballoc/vec.rs')
| -rw-r--r-- | src/liballoc/vec.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 7ef281ff208..b4a9da84787 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -971,7 +971,7 @@ impl<T> Vec<T> { } let len = self.len(); - if !(index < len) { + if index >= len { assert_failed(index, len); } unsafe { @@ -1010,7 +1010,7 @@ impl<T> Vec<T> { } let len = self.len(); - if !(index <= len) { + if index > len { assert_failed(index, len); } @@ -1058,7 +1058,7 @@ impl<T> Vec<T> { } let len = self.len(); - if !(index < len) { + if index >= len { assert_failed(index, len); } unsafe { @@ -1331,10 +1331,10 @@ impl<T> Vec<T> { panic!("end drain index (is {}) should be <= len (is {})", end, len); } - if !(start <= end) { + if start > end { start_assert_failed(start, end); } - if !(end <= len) { + if end > len { end_assert_failed(end, len); } @@ -1432,7 +1432,7 @@ impl<T> Vec<T> { panic!("`at` split index (is {}) should be <= len (is {})", at, len); } - if !(at <= self.len()) { + if at > self.len() { assert_failed(at, self.len()); } |
