Fix clippy.sh script and fix a number of clippy warnings

This commit is contained in:
Jeremy Soller
2019-10-06 11:04:06 -06:00
parent a57ea6a72b
commit 63e2a835e0
40 changed files with 196 additions and 543 deletions
+2
View File
@@ -28,6 +28,7 @@ fn validate(address: usize, size: usize, flags: EntryFlags) -> Result<()> {
}
/// Convert a pointer and length to slice, if valid
//TODO: Mark unsafe
pub fn validate_slice<T>(ptr: *const T, len: usize) -> Result<&'static [T]> {
if len == 0 {
Ok(&[])
@@ -38,6 +39,7 @@ pub fn validate_slice<T>(ptr: *const T, len: usize) -> Result<&'static [T]> {
}
/// Convert a pointer and length to slice, if valid
//TODO: Mark unsafe
pub fn validate_slice_mut<T>(ptr: *mut T, len: usize) -> Result<&'static mut [T]> {
if len == 0 {
Ok(&mut [])