aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2019-09-29 09:58:05 -0400
committerBrian Cully <bjc@kublai.com>2019-09-29 09:58:05 -0400
commit338d858f384a061afaa64c1ac1ffb62a1c448c83 (patch)
tree2ac577625b468cc3aa9ce34e3c7369cc232864fd /src
parent240d2da1e7d5b9079d88644bfef06030fb9af486 (diff)
downloadbootkbd-338d858f384a061afaa64c1ac1ffb62a1c448c83.tar.gz
bootkbd-338d858f384a061afaa64c1ac1ffb62a1c448c83.zip
Get rid of redundant cast to slice for boot report buffer.
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 703f431..94dc168 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -336,15 +336,14 @@ impl Device {
DeviceState::Running => {
if let Some(ref mut ep) = self.endpoints[0] {
let mut b: [u8; 8] = [0; 8];
- let buf = &mut b[..];
- match host.in_transfer(ep, buf) {
+ match host.in_transfer(ep, &mut b) {
Err(TransferError::Permanent(msg)) => {
error!("reading report: {}", msg);
return Err(TransferError::Permanent(msg));
}
Err(TransferError::Retry(_)) => return Ok(()),
Ok(_) => {
- callback(self.addr, buf);
+ callback(self.addr, &b);
}
}
} else {