summaryrefslogtreecommitdiff
path: root/hid
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2017-11-10 22:53:08 -0800
committerDaniel Mueller <deso@posteo.net>2017-11-10 22:53:08 -0800
commit7e6a449f276cd85ebd9201ef1a62aff3bc4d1595 (patch)
tree7f942f39db64284c09375b64c6951f3364be32d1 /hid
parent4a3c72d09d0c028fda3563e69b67c99dcd40520d (diff)
downloadnitrocli-7e6a449f276cd85ebd9201ef1a62aff3bc4d1595.tar.gz
nitrocli-7e6a449f276cd85ebd9201ef1a62aff3bc4d1595.tar.bz2
Update hid crate to 0.4.1
Import subrepo hid/:hid at 6dc63c8682bd2f027c0d3b4a004b097ca9ac49fa
Diffstat (limited to 'hid')
-rw-r--r--hid/Cargo.toml2
-rw-r--r--hid/src/handle.rs3
-rw-r--r--hid/src/lib.rs2
3 files changed, 4 insertions, 3 deletions
diff --git a/hid/Cargo.toml b/hid/Cargo.toml
index 91111a4..5e608a8 100644
--- a/hid/Cargo.toml
+++ b/hid/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "hid"
-version = "0.4.0"
+version = "0.4.1"
authors = ["meh. <meh@schizofreni.co>"]
license = "WTFPL"
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;