From 8477daa8b970ae8ef042a5242aee705003b63fc1 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Wed, 17 Apr 2019 15:25:51 +0200 Subject: Fix clippy warnings --- core/examples/http_bench.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/examples') diff --git a/core/examples/http_bench.rs b/core/examples/http_bench.rs index e4598a7b3..7cacf79b0 100644 --- a/core/examples/http_bench.rs +++ b/core/examples/http_bench.rs @@ -61,6 +61,7 @@ impl Into for Record { impl From<&[u8]> for Record { fn from(s: &[u8]) -> Record { + #[allow(clippy::cast_ptr_alignment)] let ptr = s.as_ptr() as *const i32; let ints = unsafe { std::slice::from_raw_parts(ptr, 4) }; Record { @@ -75,7 +76,7 @@ impl From<&[u8]> for Record { impl From for Record { fn from(buf: Buf) -> Record { assert_eq!(buf.len(), 4 * 4); - //let byte_len = buf.len(); + #[allow(clippy::cast_ptr_alignment)] let ptr = Box::into_raw(buf) as *mut [i32; 4]; let ints: Box<[i32]> = unsafe { Box::from_raw(ptr) }; assert_eq!(ints.len(), 4); -- cgit v1.2.3