aboutsummaryrefslogtreecommitdiff
path: root/hid/src
diff options
context:
space:
mode:
Diffstat (limited to 'hid/src')
-rw-r--r--hid/src/handle.rs3
-rw-r--r--hid/src/lib.rs2
2 files changed, 3 insertions, 2 deletions
diff --git a/hid/src/handle.rs b/hid/src/handle.rs
index 759c87e..d0eb090 100644
--- a/hid/src/handle.rs
+++ b/hid/src/handle.rs
@@ -4,6 +4,7 @@ use libc::c_int;
use sys::*;
use error::{self, Error};
+/// A device handle.
pub struct Handle {
ptr: *mut hid_device,
}
@@ -131,7 +132,7 @@ impl<'a> Data<'a> {
///
/// Returns the report ID and the amount of read bytes or `None` if there was a timeout.
pub fn read_from<T: AsMut<[u8]>>(&mut self, mut data: T, timeout: Duration) -> error::Result<Option<(u8, usize)>> {
- let mut data = data.as_mut();
+ let data = data.as_mut();
let mut buffer = Vec::with_capacity(data.len() + 1);
if let Some(length) = self.read(&mut buffer, timeout)? {
diff --git a/hid/src/lib.rs b/hid/src/lib.rs
index d71b5a5..fb2ccf8 100644
--- a/hid/src/lib.rs
+++ b/hid/src/lib.rs
@@ -13,5 +13,5 @@ pub use devices::Devices;
mod device;
pub use device::Device;
-mod handle;
+pub mod handle;
pub use handle::Handle;