Fix Clippy warnings

This commit is contained in:
Mateusz Mikuła
2019-05-10 12:01:02 +02:00
parent 30f6a9c323
commit 7597c082e7
20 changed files with 115 additions and 126 deletions
+2 -1
View File
@@ -265,6 +265,7 @@ pub unsafe extern "C" fn exit(status: c_int) {
// Look for the neighbor functions in memory until the end
let mut f = &__fini_array_end as *const _;
#[allow(clippy::op_ref)]
while f > &__fini_array_start {
f = f.offset(-1);
(*f)();
@@ -846,7 +847,7 @@ pub unsafe fn convert_hex(s: *const c_char) -> Option<(c_ulong, isize, bool)> {
pub unsafe fn convert_integer(s: *const c_char, base: c_int) -> Option<(c_ulong, isize, bool)> {
// -1 means the character is invalid
#[cfg_attr(rustfmt, rustfmt_skip)]
#[rustfmt::skip]
const LOOKUP_TABLE: [c_long; 256] = [
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+1 -1
View File
@@ -107,7 +107,7 @@ fn heapify(
// we start at the last parent in the heap (the parent of the last child)
let last_parent = (nel - 2) / 2;
for start in (0..last_parent + 1).rev() {
for start in (0..=last_parent).rev() {
heap_sift_down(base, start, nel - 1, width, comp);
}
}