mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
rog-platform: change current_value() to &mut
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"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"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ impl Attribute {
|
|||||||
&self.help
|
&self.help
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn current_value(&self) -> &AttrValue {
|
pub fn current_value(&mut self) -> &mut AttrValue {
|
||||||
&self.current_value
|
&mut self.current_value
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn default_value(&self) -> &AttrValue {
|
pub fn default_value(&self) -> &AttrValue {
|
||||||
@@ -270,10 +270,10 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_boot_sound() {
|
fn test_boot_sound() {
|
||||||
let attrs = FirmwareAttributes::new();
|
let mut attrs = FirmwareAttributes::new();
|
||||||
let attr = attrs
|
let attr = attrs
|
||||||
.attributes()
|
.attributes_mut()
|
||||||
.iter()
|
.iter_mut()
|
||||||
.find(|a| a.name() == "boot_sound")
|
.find(|a| a.name() == "boot_sound")
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ pub struct HidRaw {
|
|||||||
syspath: PathBuf,
|
syspath: PathBuf,
|
||||||
/// The product ID. The vendor ID is not kept
|
/// The product ID. The vendor ID is not kept
|
||||||
prod_id: String,
|
prod_id: String,
|
||||||
device_bcd: u32,
|
_device_bcd: u32,
|
||||||
/// Retaining a handle to the file for the duration of `HidRaw`
|
/// Retaining a handle to the file for the duration of `HidRaw`
|
||||||
file: RefCell<File>,
|
file: RefCell<File>,
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ impl HidRaw {
|
|||||||
devfs_path: dev_node.to_owned(),
|
devfs_path: dev_node.to_owned(),
|
||||||
prod_id: id_product.to_string(),
|
prod_id: id_product.to_string(),
|
||||||
syspath: endpoint.syspath().into(),
|
syspath: endpoint.syspath().into(),
|
||||||
device_bcd: usb_device
|
_device_bcd: usb_device
|
||||||
.attribute_value("bcdDevice")
|
.attribute_value("bcdDevice")
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
.to_string_lossy()
|
.to_string_lossy()
|
||||||
@@ -77,7 +77,7 @@ impl HidRaw {
|
|||||||
devfs_path: dev_node.to_owned(),
|
devfs_path: dev_node.to_owned(),
|
||||||
prod_id: id_product.to_string(),
|
prod_id: id_product.to_string(),
|
||||||
syspath: endpoint.syspath().into(),
|
syspath: endpoint.syspath().into(),
|
||||||
device_bcd: endpoint
|
_device_bcd: endpoint
|
||||||
.attribute_value("bcdDevice")
|
.attribute_value("bcdDevice")
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
.to_string_lossy()
|
.to_string_lossy()
|
||||||
@@ -107,7 +107,7 @@ impl HidRaw {
|
|||||||
devfs_path: dev_node.to_owned(),
|
devfs_path: dev_node.to_owned(),
|
||||||
prod_id: id_product.to_string_lossy().into(),
|
prod_id: id_product.to_string_lossy().into(),
|
||||||
syspath: device.syspath().into(),
|
syspath: device.syspath().into(),
|
||||||
device_bcd: device
|
_device_bcd: device
|
||||||
.attribute_value("bcdDevice")
|
.attribute_value("bcdDevice")
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
.to_string_lossy()
|
.to_string_lossy()
|
||||||
|
|||||||
Reference in New Issue
Block a user