Skip to content

Commit

Permalink
suppress the unused_unsafe lint in macro code (#14)
Browse files Browse the repository at this point in the history
Previously if you used any of the macros inside an unsafe block of your
own, the compiler would complain that you were unnecessarily nesting
unsafe blocks.
  • Loading branch information
oconnor663 authored and droundy committed Aug 15, 2018
1 parent 9ca363a commit f151f5c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ macro_rules! array_ref {
}
let offset = $offset;
let slice = & $arr[offset..offset + $len];
#[allow(unused_unsafe)]
unsafe {
as_array(slice)
}
Expand Down Expand Up @@ -127,6 +128,7 @@ macro_rules! array_refs {
} ),*)
}
let input = $arr;
#[allow(unused_unsafe)]
unsafe {
as_arrays(input)
}
Expand All @@ -145,6 +147,7 @@ macro_rules! array_refs {
} ),* )
}
let input = $arr;
#[allow(unused_unsafe)]
unsafe {
as_arrays(input)
}
Expand Down Expand Up @@ -220,6 +223,7 @@ macro_rules! mut_array_refs {
} ),*)
}
let input = $arr;
#[allow(unused_unsafe)]
unsafe {
as_arrays(input)
}
Expand All @@ -238,6 +242,7 @@ macro_rules! mut_array_refs {
} ),* )
}
let input = $arr;
#[allow(unused_unsafe)]
unsafe {
as_arrays(input)
}
Expand Down Expand Up @@ -279,6 +284,7 @@ macro_rules! array_mut_ref {
}
let offset = $offset;
let slice = &mut $arr[offset..offset + $len];
#[allow(unused_unsafe)]
unsafe {
as_array(slice)
}
Expand Down

0 comments on commit f151f5c

Please sign in to comment.