From 0d162c3d9e6a220fe30768bedcb129bf04a2cc7b Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Wed, 20 Feb 2019 11:40:09 +0000 Subject: Use arrays instead of slices where possible To increase type safety, we use references to (sized) arrays instead of slices where possible. --- src/util.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/util.rs') diff --git a/src/util.rs b/src/util.rs index cbe7c0d..c86d047 100644 --- a/src/util.rs +++ b/src/util.rs @@ -21,7 +21,11 @@ macro_rules! enum_cmd { } impl $name { - pub fn execute(&self, data: &[u8], buf: &mut [u8]) -> CommandStatus { + pub fn execute( + &self, + data: &crate::device::RequestData, + buf: &mut crate::device::ResponseData, + ) -> CommandStatus { match *self { $( $name::$var => crate::commands::execute::<$cmd>(data, buf), -- cgit v1.2.1