summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/device.rs7
2 files changed, 8 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fcba0f3..718b796 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -36,6 +36,7 @@ SPDX-License-Identifier: MIT
- Add `set_encrypted_volume_mode` to `Storage`.
- Use mutability to represent changes to the device status:
- Implement `DerefMut` for `User<T>` and `Admin<T>`.
+ - Add `device_mut` method to `DeviceWrapper`.
# v0.3.4 (2019-01-20)
- Fix authentication methods that assumed that `char` is signed.
diff --git a/src/device.rs b/src/device.rs
index c985802..462e9dc 100644
--- a/src/device.rs
+++ b/src/device.rs
@@ -728,6 +728,13 @@ impl DeviceWrapper {
DeviceWrapper::Pro(ref pro) => pro,
}
}
+
+ fn device_mut(&mut self) -> &mut dyn Device {
+ match *self {
+ DeviceWrapper::Storage(ref mut storage) => storage,
+ DeviceWrapper::Pro(ref mut pro) => pro,
+ }
+ }
}
impl From<Pro> for DeviceWrapper {