Skip to content

Commit 4d5e4d7

Browse files
committed
Fixing clippy errors
1 parent 91a8f68 commit 4d5e4d7

File tree

15 files changed

+957
-968
lines changed

15 files changed

+957
-968
lines changed

examples/watchnodes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use futures::{AsyncReadExt, FutureExt};
2424
use hid_io_core::common_capnp::NodeType;
2525
use hid_io_core::hidio_capnp::hid_io;
2626
use hid_io_core::hidio_capnp::hid_io_server;
27-
use hid_io_protocol::HidIoCommandID;
27+
use hid_io_protocol::HidIoCommandId;
2828
use rand::Rng;
2929
use std::collections::HashMap;
3030
use std::convert::TryFrom;
@@ -120,7 +120,7 @@ impl NodesSubscriberImpl {
120120
src_node_type,
121121
dst,
122122
dst_node_type,
123-
HidIoCommandID::try_from(packet.get_id()).unwrap_or(HidIoCommandID::Unused),
123+
HidIoCommandId::try_from(packet.get_id()).unwrap_or(HidIoCommandId::Unused),
124124
packet.get_id(),
125125
datalen,
126126
)
@@ -133,7 +133,7 @@ impl NodesSubscriberImpl {
133133
src_node_type,
134134
dst,
135135
dst_node_type,
136-
HidIoCommandID::try_from(packet.get_id()).unwrap_or(HidIoCommandID::Unused),
136+
HidIoCommandId::try_from(packet.get_id()).unwrap_or(HidIoCommandId::Unused),
137137
packet.get_id(),
138138
datalen,
139139
datastr,

hid-io-kiibohd/src/lib.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,13 @@ pub extern "C" fn hidio_txbyte_bufsize() -> u16 {
215215
#[no_mangle]
216216
pub extern "C" fn hidio_init(config: HidioConfig) -> HidioStatus {
217217
let ids = [
218-
HidIoCommandID::FlashMode,
219-
HidIoCommandID::GetInfo,
220-
HidIoCommandID::ManufacturingTest,
221-
HidIoCommandID::SleepMode,
222-
HidIoCommandID::SupportedIDs,
223-
HidIoCommandID::TerminalCmd,
224-
HidIoCommandID::TestPacket,
218+
HidIoCommandId::FlashMode,
219+
HidIoCommandId::GetInfo,
220+
HidIoCommandId::ManufacturingTest,
221+
HidIoCommandId::SleepMode,
222+
HidIoCommandId::SupportedIds,
223+
HidIoCommandId::TerminalCmd,
224+
HidIoCommandId::TestPacket,
225225
];
226226

227227
unsafe {
@@ -671,13 +671,13 @@ struct CommandInterface<
671671
N: ArrayLength<u8>,
672672
H: ArrayLength<u8>,
673673
S: ArrayLength<u8>,
674-
ID: ArrayLength<HidIoCommandID> + ArrayLength<u8>,
674+
ID: ArrayLength<HidIoCommandId> + ArrayLength<u8>,
675675
> where
676676
H: core::fmt::Debug,
677677
H: Sub<B1>,
678678
H: Sub<U4>,
679679
{
680-
ids: Vec<HidIoCommandID, ID>,
680+
ids: Vec<HidIoCommandId, ID>,
681681
rx_bytebuf: buffer::Buffer<RX, N>,
682682
rx_packetbuf: HidIoPacketBuffer<H>,
683683
tx_bytebuf: buffer::Buffer<TX, N>,
@@ -696,15 +696,15 @@ impl<
696696
N: ArrayLength<u8>,
697697
H: ArrayLength<u8>,
698698
S: ArrayLength<u8>,
699-
ID: ArrayLength<HidIoCommandID> + ArrayLength<u8>,
699+
ID: ArrayLength<HidIoCommandId> + ArrayLength<u8>,
700700
> CommandInterface<TX, RX, N, H, S, ID>
701701
where
702702
H: core::fmt::Debug,
703703
H: Sub<B1>,
704704
H: Sub<U4>,
705705
{
706706
fn new(
707-
ids: &[HidIoCommandID],
707+
ids: &[HidIoCommandId],
708708
config: HidioConfig,
709709
) -> Result<CommandInterface<TX, RX, N, H, S, ID>, CommandError> {
710710
// Make sure we have a large enough id vec
@@ -901,14 +901,14 @@ where
901901
/// N - Max payload length (HidIoPacketBuffer), used for default values
902902
/// H - Max data payload length (HidIoPacketBuffer)
903903
/// S - Serialization buffer size
904-
/// ID - Max number of HidIoCommandIDs
904+
/// ID - Max number of HidIoCommandIds
905905
impl<
906906
TX: ArrayLength<Vec<u8, N>>,
907907
RX: ArrayLength<Vec<u8, N>>,
908908
N: ArrayLength<u8>,
909909
H: ArrayLength<u8>,
910910
S: ArrayLength<u8>,
911-
ID: ArrayLength<HidIoCommandID> + ArrayLength<u8>,
911+
ID: ArrayLength<HidIoCommandId> + ArrayLength<u8>,
912912
> Commands<H, ID> for CommandInterface<TX, RX, N, H, S, ID>
913913
where
914914
H: core::fmt::Debug + Sub<B1> + Sub<U4>,
@@ -954,7 +954,7 @@ where
954954
}
955955
Ok(())
956956
}
957-
fn supported_id(&self, id: HidIoCommandID) -> bool {
957+
fn supported_id(&self, id: HidIoCommandId) -> bool {
958958
self.ids.iter().any(|&i| i == id)
959959
}
960960

@@ -973,7 +973,7 @@ where
973973
use h0001::*;
974974

975975
let property = data.property;
976-
let os = OSType::Unknown;
976+
let os = OsType::Unknown;
977977
let mut number = 0;
978978
let mut string = String::new();
979979

@@ -1001,7 +1001,7 @@ where
10011001
}
10021002
};
10031003
}
1004-
Property::DeviceMCU => {
1004+
Property::DeviceMcu => {
10051005
unsafe {
10061006
if let Ok(cstr) = CStr::from_ptr(self.config.device_mcu).to_str() {
10071007
string = String::from(cstr);

0 commit comments

Comments
 (0)