Change vendor_id and product_id functions to return clones of u16

This commit is contained in:
asivery 2024-03-10 13:28:28 +01:00
parent 3fd6bb4c4b
commit afd799d07d
2 changed files with 6 additions and 6 deletions

View file

@ -140,13 +140,13 @@ impl NetMD {
} }
/// Gets the vendor id /// Gets the vendor id
pub fn vendor_id(&self) -> &u16 { pub fn vendor_id(&self) -> u16 {
&self.model.vendor_id self.model.vendor_id
} }
/// Gets the product id /// Gets the product id
pub fn product_id(&self) -> &u16 { pub fn product_id(&self) -> u16 {
&self.model.product_id self.model.product_id
} }
/// Poll the device to get either the result /// Poll the device to get either the result

View file

@ -1033,7 +1033,7 @@ impl NetMDInterface {
let new_len = new_title.len(); let new_len = new_title.len();
if self.net_md_device.vendor_id() == &0x04dd { if self.net_md_device.vendor_id() == 0x04dd {
self.change_descriptor_state(&Descriptor::AudioUTOC1TD, &DescriptorAction::OpenWrite) self.change_descriptor_state(&Descriptor::AudioUTOC1TD, &DescriptorAction::OpenWrite)
.await .await
} else { } else {
@ -1055,7 +1055,7 @@ impl NetMDInterface {
let _ = self.send_query(&mut query, false, false).await; let _ = self.send_query(&mut query, false, false).await;
if self.net_md_device.vendor_id() == &0x04dd { if self.net_md_device.vendor_id() == 0x04dd {
self.change_descriptor_state(&Descriptor::AudioUTOC1TD, &DescriptorAction::Close) self.change_descriptor_state(&Descriptor::AudioUTOC1TD, &DescriptorAction::Close)
.await .await
} else { } else {