mirror of
https://github.com/G2-Games/minidisc-cli.git
synced 2025-04-19 11:42:53 -05:00
Cleaned up clippy suggestions
This commit is contained in:
parent
c49a86ed75
commit
ac29c6a0a5
2 changed files with 6 additions and 7 deletions
|
@ -10,6 +10,7 @@ type DesEcbEnc = ecb::Decryptor<des::Des>;
|
||||||
type DesCbcEnc = cbc::Encryptor<des::Des>;
|
type DesCbcEnc = cbc::Encryptor<des::Des>;
|
||||||
|
|
||||||
pub struct Encryptor {
|
pub struct Encryptor {
|
||||||
|
#[allow(clippy::type_complexity)]
|
||||||
channel: Option<UnboundedReceiver<(Vec<u8>, Vec<u8>, Vec<u8>)>>,
|
channel: Option<UnboundedReceiver<(Vec<u8>, Vec<u8>, Vec<u8>)>>,
|
||||||
state: Option<EncryptorState>,
|
state: Option<EncryptorState>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -455,7 +455,7 @@ impl NetMDInterface {
|
||||||
/// Send a query to the NetMD player
|
/// Send a query to the NetMD player
|
||||||
async fn send_query(
|
async fn send_query(
|
||||||
&mut self,
|
&mut self,
|
||||||
query: &Vec<u8>,
|
query: &[u8],
|
||||||
test: bool,
|
test: bool,
|
||||||
accept_interim: bool,
|
accept_interim: bool,
|
||||||
) -> Result<Vec<u8>, InterfaceError> {
|
) -> Result<Vec<u8>, InterfaceError> {
|
||||||
|
@ -468,7 +468,7 @@ impl NetMDInterface {
|
||||||
|
|
||||||
async fn send_command(
|
async fn send_command(
|
||||||
&mut self,
|
&mut self,
|
||||||
query: &Vec<u8>,
|
query: &[u8],
|
||||||
test: bool,
|
test: bool,
|
||||||
) -> Result<(), InterfaceError> {
|
) -> Result<(), InterfaceError> {
|
||||||
let status_byte = match test {
|
let status_byte = match test {
|
||||||
|
@ -479,7 +479,7 @@ impl NetMDInterface {
|
||||||
let mut new_query = Vec::new();
|
let mut new_query = Vec::new();
|
||||||
|
|
||||||
new_query.push(status_byte as u8);
|
new_query.push(status_byte as u8);
|
||||||
new_query.extend_from_slice(&query);
|
new_query.extend_from_slice(query);
|
||||||
|
|
||||||
self.device.send_command(new_query).await?;
|
self.device.send_command(new_query).await?;
|
||||||
|
|
||||||
|
@ -650,10 +650,8 @@ impl NetMDInterface {
|
||||||
self.change_descriptor_state(&Descriptor::OperatingStatusBlock, &DescriptorAction::Close)
|
self.change_descriptor_state(&Descriptor::OperatingStatusBlock, &DescriptorAction::Close)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
if operating_status.len() < 2 {
|
if operating_status.len() < 2 && !operating_status.is_empty() {
|
||||||
if !operating_status.is_empty() {
|
return Err(InterfaceError::InvalidStatus(StatusError(operating_status[0] as u16)));
|
||||||
return Err(InterfaceError::InvalidStatus(StatusError(operating_status[0] as u16)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let operating_status_number =
|
let operating_status_number =
|
||||||
|
|
Loading…
Reference in a new issue