aboutsummaryrefslogtreecommitdiff
path: root/src/util.rs
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2019-02-20 11:40:09 +0000
committerRobin Krahl <robin.krahl@ireas.org>2019-02-20 12:50:25 +0100
commit0d162c3d9e6a220fe30768bedcb129bf04a2cc7b (patch)
tree926faf97c7ba1233289290a936db8d7b7c0a8384 /src/util.rs
parent990063fb3ecfc6baeb51e4f57b3f75ee16bac56e (diff)
downloadntw-0d162c3d9e6a220fe30768bedcb129bf04a2cc7b.tar.gz
ntw-0d162c3d9e6a220fe30768bedcb129bf04a2cc7b.tar.bz2
Use arrays instead of slices where possible
To increase type safety, we use references to (sized) arrays instead of slices where possible.
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs6
1 files changed, 5 insertions, 1 deletions
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),