aboutsummaryrefslogtreecommitdiff
path: root/hypervisor
diff options
context:
space:
mode:
authorDaniel Verkamp <dverkamp@chromium.org>2023-03-31 13:31:18 -0700
committercrosvm LUCI <crosvm-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-04-04 22:12:39 +0000
commit10a487a72515d2cb2b78ea79175a91a7f9973d48 (patch)
tree4bb52d566c6121e99524c9d73ff8b64dfcee0627 /hypervisor
parent5821cc641076600632bbce5a0c3736a0053e48e7 (diff)
downloadcrosvm-10a487a72515d2cb2b78ea79175a91a7f9973d48.tar.gz
tree-wide: replace manual enum Defaults with derive
This is supported since Rust 1.62. Fixes the new derivable_impls clippy lint, added in Rust 1.67. BUG=b:276487055 TEST=tools/clippy # with rust 1.68 Change-Id: I3696dd3cf4acbf9b5a2cfa8c2046e7656e13dbbd Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4390735 Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Diffstat (limited to 'hypervisor')
-rw-r--r--hypervisor/src/x86_64.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/hypervisor/src/x86_64.rs b/hypervisor/src/x86_64.rs
index 1fe86d4c2..7f0093dec 100644
--- a/hypervisor/src/x86_64.rs
+++ b/hypervisor/src/x86_64.rs
@@ -458,8 +458,9 @@ pub enum PicSelect {
}
#[repr(C)]
-#[derive(enumn::N, Debug, Clone, Copy, PartialEq, Eq)]
+#[derive(enumn::N, Debug, Clone, Copy, Default, PartialEq, Eq)]
pub enum PicInitState {
+ #[default]
Icw1 = 0,
Icw2 = 1,
Icw3 = 2,
@@ -476,12 +477,6 @@ impl From<u8> for PicInitState {
}
}
-impl Default for PicInitState {
- fn default() -> Self {
- PicInitState::Icw1
- }
-}
-
/// Represents the state of the PIC.
#[repr(C)]
#[derive(Clone, Copy, Default, Debug, PartialEq, Eq)]