Skip to content

Commit 249bf29

Browse files
committed
fix up the clippy warnings against 1.91.0
1 parent 9cf39ac commit 249bf29

File tree

2 files changed

+8
-20
lines changed

2 files changed

+8
-20
lines changed

src/bitfield.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ pub struct Flag<'a> {
1818

1919
/// There are 2 types of *Bit Field* flag meaningful and reserved for some purposes
2020
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
21+
#[derive(Default)]
2122
pub enum FlagType<'a> {
23+
#[default]
2224
Unknown,
2325
Significant(&'a str, &'a str),
2426
Reserved(&'a str),
@@ -165,11 +167,6 @@ impl fmt::Debug for Flag<'_> {
165167
}
166168
}
167169

168-
impl Default for FlagType<'_> {
169-
fn default() -> Self {
170-
Self::Unknown
171-
}
172-
}
173170

174171
impl<'a, T> Iter<'a, T> {
175172
fn new(value: T, layout: Layout<'a>) -> Self {

src/structures/016_physical_memory_array.rs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ use core::fmt;
99
use crate::{MalformedStructureError, RawStructure};
1010

1111
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
12+
#[derive(Default)]
1213
pub enum MemoryArrayLocation {
1314
Other,
15+
#[default]
1416
Unknown,
1517
SystemBoardOrMotherboard,
1618
IsaAddOnCard,
@@ -28,11 +30,6 @@ pub enum MemoryArrayLocation {
2830
Undefined(u8),
2931
}
3032

31-
impl Default for MemoryArrayLocation {
32-
fn default() -> Self {
33-
Self::Unknown
34-
}
35-
}
3633

3734
impl From<u8> for MemoryArrayLocation {
3835
fn from(_type: u8) -> Self {
@@ -81,8 +78,10 @@ impl fmt::Display for MemoryArrayLocation {
8178
}
8279

8380
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
81+
#[derive(Default)]
8482
pub enum MemoryArrayUse {
8583
Other,
84+
#[default]
8685
Unknown,
8786
SystemMemory,
8887
VideoMemory,
@@ -92,11 +91,6 @@ pub enum MemoryArrayUse {
9291
Undefined(u8),
9392
}
9493

95-
impl Default for MemoryArrayUse {
96-
fn default() -> Self {
97-
Self::Unknown
98-
}
99-
}
10094

10195
impl From<u8> for MemoryArrayUse {
10296
fn from(_type: u8) -> Self {
@@ -129,8 +123,10 @@ impl fmt::Display for MemoryArrayUse {
129123
}
130124

131125
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
126+
#[derive(Default)]
132127
pub enum MemoryArrayErrorCorrectionTypes {
133128
Other,
129+
#[default]
134130
Unknown,
135131
None,
136132
Parity,
@@ -140,11 +136,6 @@ pub enum MemoryArrayErrorCorrectionTypes {
140136
Undefined(u8),
141137
}
142138

143-
impl Default for MemoryArrayErrorCorrectionTypes {
144-
fn default() -> Self {
145-
Self::Unknown
146-
}
147-
}
148139

149140
impl From<u8> for MemoryArrayErrorCorrectionTypes {
150141
fn from(_type: u8) -> Self {

0 commit comments

Comments
 (0)