Skip to content

Commit d8c4806

Browse files
committed
Fixed clippy warnings
1 parent 29a3b97 commit d8c4806

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

src/bitfield.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl<'a, T: Bindable> Bound<'a, T> {
137137
}
138138
}
139139

140-
impl<'a> fmt::Display for Bound<'a, Flag> {
140+
impl fmt::Display for Bound<'_, Flag> {
141141
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
142142
write!(
143143
f,
@@ -152,7 +152,7 @@ impl<'a> fmt::Display for Bound<'a, Flag> {
152152
}
153153
}
154154

155-
impl<'a> fmt::Display for Bound<'a, Int> {
155+
impl fmt::Display for Bound<'_, Int> {
156156
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
157157
write!(
158158
f,
@@ -163,7 +163,7 @@ impl<'a> fmt::Display for Bound<'a, Int> {
163163
}
164164
}
165165

166-
impl<'a, B, R, T: From<u32> + From<bool>> Facter<T> for Bound<'a, B>
166+
impl<B, R, T: From<u32> + From<bool>> Facter<T> for Bound<'_, B>
167167
where
168168
R: Default + Into<T>,
169169
B: Bindable<Rep = R>,
@@ -176,7 +176,7 @@ where
176176
}
177177
}
178178

179-
impl<'a> fmt::Display for Bound<'a, X86Model> {
179+
impl fmt::Display for Bound<'_, X86Model> {
180180
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
181181
write!(
182182
f,
@@ -187,7 +187,7 @@ impl<'a> fmt::Display for Bound<'a, X86Model> {
187187
}
188188
}
189189

190-
impl<'a> fmt::Display for Bound<'a, X86Family> {
190+
impl fmt::Display for Bound<'_, X86Family> {
191191
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
192192
write!(
193193
f,
@@ -225,7 +225,7 @@ impl<'a> BoundField<'a> {
225225
}
226226
}
227227

228-
impl<'a> fmt::Display for BoundField<'a> {
228+
impl fmt::Display for BoundField<'_> {
229229
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
230230
match self {
231231
Self::Int(bound) => bound.fmt(f),
@@ -236,7 +236,7 @@ impl<'a> fmt::Display for BoundField<'a> {
236236
}
237237
}
238238

239-
impl<'a, T: From<bool> + From<u32>> Facter<T> for BoundField<'a> {
239+
impl<T: From<bool> + From<u32>> Facter<T> for BoundField<'_> {
240240
fn collect_fact(&self) -> GenericFact<T> {
241241
match self {
242242
Self::Int(bound) => bound.collect_fact(),

src/layout.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ pub struct BoundLeaf<'a> {
335335
pub sub_leaves: Vec<CpuidResult>,
336336
}
337337

338-
impl<'a> BoundLeaf<'a> {
338+
impl BoundLeaf<'_> {
339339
pub fn get_facts<T: From<u32> + From<bool> + From<String>>(&self) -> Vec<GenericFact<T>> {
340340
let mut facts = self.desc.get_facts(&self.sub_leaves);
341341
facts.iter_mut().for_each(|i| {
@@ -345,13 +345,13 @@ impl<'a> BoundLeaf<'a> {
345345
}
346346
}
347347

348-
impl<'a, T: From<u32> + From<bool> + From<String>> facts::Facter<GenericFact<T>> for BoundLeaf<'a> {
348+
impl<T: From<u32> + From<bool> + From<String>> facts::Facter<GenericFact<T>> for BoundLeaf<'_> {
349349
fn collect_facts(&self) -> Vec<GenericFact<T>> {
350350
self.get_facts()
351351
}
352352
}
353353

354-
impl<'a> fmt::Display for BoundLeaf<'a> {
354+
impl fmt::Display for BoundLeaf<'_> {
355355
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
356356
self.desc.display_leaf(&self.sub_leaves, f)
357357
}

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ impl CpuidDB for RunningCpuidDB {
9595
0..=0x3FFFFFFF => leaf <= self.basic_max,
9696
0x40000000..=0x4fffffff => self
9797
.hypervisor_max
98-
.map_or(false, |max| leaf - 0x40000000 <= max),
98+
.is_some_and(|max| leaf - 0x40000000 <= max),
9999
0x80000000..=0x8fffffff => leaf - 0x80000000 <= self.extended_max,
100100
_ => false,
101101
} {

src/msr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pub struct MSRValue<'a> {
114114
pub value: u64,
115115
}
116116

117-
impl<'a, T: From<u32> + From<bool> + From<String>> facts::Facter<GenericFact<T>> for MSRValue<'a> {
117+
impl<T: From<u32> + From<bool> + From<String>> facts::Facter<GenericFact<T>> for MSRValue<'_> {
118118
fn collect_facts(&self) -> Vec<GenericFact<T>> {
119119
let value = self.value.into();
120120
self.desc
@@ -130,7 +130,7 @@ impl<'a, T: From<u32> + From<bool> + From<String>> facts::Facter<GenericFact<T>>
130130
}
131131
}
132132

133-
impl<'a> fmt::Display for MSRValue<'a> {
133+
impl fmt::Display for MSRValue<'_> {
134134
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
135135
writeln!(f, "{} = {:#x}", self.desc, self.value)?;
136136
for field in &self.desc.fields {

0 commit comments

Comments
 (0)