mirror of
https://github.com/G2-Games/minidisc-cli.git
synced 2025-04-19 03:32: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>;
|
||||
|
||||
pub struct Encryptor {
|
||||
#[allow(clippy::type_complexity)]
|
||||
channel: Option<UnboundedReceiver<(Vec<u8>, Vec<u8>, Vec<u8>)>>,
|
||||
state: Option<EncryptorState>,
|
||||
}
|
||||
|
|
|
@ -455,7 +455,7 @@ impl NetMDInterface {
|
|||
/// Send a query to the NetMD player
|
||||
async fn send_query(
|
||||
&mut self,
|
||||
query: &Vec<u8>,
|
||||
query: &[u8],
|
||||
test: bool,
|
||||
accept_interim: bool,
|
||||
) -> Result<Vec<u8>, InterfaceError> {
|
||||
|
@ -468,7 +468,7 @@ impl NetMDInterface {
|
|||
|
||||
async fn send_command(
|
||||
&mut self,
|
||||
query: &Vec<u8>,
|
||||
query: &[u8],
|
||||
test: bool,
|
||||
) -> Result<(), InterfaceError> {
|
||||
let status_byte = match test {
|
||||
|
@ -479,7 +479,7 @@ impl NetMDInterface {
|
|||
let mut new_query = Vec::new();
|
||||
|
||||
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?;
|
||||
|
||||
|
@ -650,11 +650,9 @@ impl NetMDInterface {
|
|||
self.change_descriptor_state(&Descriptor::OperatingStatusBlock, &DescriptorAction::Close)
|
||||
.await?;
|
||||
|
||||
if operating_status.len() < 2 {
|
||||
if !operating_status.is_empty() {
|
||||
if operating_status.len() < 2 && !operating_status.is_empty() {
|
||||
return Err(InterfaceError::InvalidStatus(StatusError(operating_status[0] as u16)));
|
||||
}
|
||||
}
|
||||
|
||||
let operating_status_number =
|
||||
(operating_status[0] as u16) << 8 | operating_status[1] as u16;
|
||||
|
|
Loading…
Reference in a new issue