From e866b4eeb1180ba798ff6b38884c2e2f9db50687 Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Sat, 7 Sep 2024 17:05:33 +1200 Subject: [PATCH] rog-platform: change current_value() to &mut --- .../translations/en/rog-control-center.po | 2 +- rog-platform/src/firmware_attributes.rs | 10 +++++----- rog-platform/src/hid_raw.rs | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/rog-control-center/translations/en/rog-control-center.po b/rog-control-center/translations/en/rog-control-center.po index 4bd4d235..2abee529 100644 --- a/rog-control-center/translations/en/rog-control-center.po +++ b/rog-control-center/translations/en/rog-control-center.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2024-08-30 23:16+0000\n" +"POT-Creation-Date: 2024-09-07 05:05+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/rog-platform/src/firmware_attributes.rs b/rog-platform/src/firmware_attributes.rs index 9cebfbf0..2c8b383b 100644 --- a/rog-platform/src/firmware_attributes.rs +++ b/rog-platform/src/firmware_attributes.rs @@ -56,8 +56,8 @@ impl Attribute { &self.help } - pub fn current_value(&self) -> &AttrValue { - &self.current_value + pub fn current_value(&mut self) -> &mut AttrValue { + &mut self.current_value } pub fn default_value(&self) -> &AttrValue { @@ -270,10 +270,10 @@ mod tests { #[test] fn test_boot_sound() { - let attrs = FirmwareAttributes::new(); + let mut attrs = FirmwareAttributes::new(); let attr = attrs - .attributes() - .iter() + .attributes_mut() + .iter_mut() .find(|a| a.name() == "boot_sound") .unwrap(); diff --git a/rog-platform/src/hid_raw.rs b/rog-platform/src/hid_raw.rs index 38330ad5..67884d7f 100644 --- a/rog-platform/src/hid_raw.rs +++ b/rog-platform/src/hid_raw.rs @@ -17,7 +17,7 @@ pub struct HidRaw { syspath: PathBuf, /// The product ID. The vendor ID is not kept prod_id: String, - device_bcd: u32, + _device_bcd: u32, /// Retaining a handle to the file for the duration of `HidRaw` file: RefCell, } @@ -53,7 +53,7 @@ impl HidRaw { devfs_path: dev_node.to_owned(), prod_id: id_product.to_string(), syspath: endpoint.syspath().into(), - device_bcd: usb_device + _device_bcd: usb_device .attribute_value("bcdDevice") .unwrap_or_default() .to_string_lossy() @@ -77,7 +77,7 @@ impl HidRaw { devfs_path: dev_node.to_owned(), prod_id: id_product.to_string(), syspath: endpoint.syspath().into(), - device_bcd: endpoint + _device_bcd: endpoint .attribute_value("bcdDevice") .unwrap_or_default() .to_string_lossy() @@ -107,7 +107,7 @@ impl HidRaw { devfs_path: dev_node.to_owned(), prod_id: id_product.to_string_lossy().into(), syspath: device.syspath().into(), - device_bcd: device + _device_bcd: device .attribute_value("bcdDevice") .unwrap_or_default() .to_string_lossy()