Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ serde_json = "1.0.117"
core_affinity = "^0.8.1"

[target.'cfg(target_os = "linux")'.dependencies]
kvm-ioctls = { version = "0.17", optional = true }
kvm-bindings = { version = "0.8", features = ["fam-wrappers"], optional = true }
kvm-ioctls = { version = "0.21", optional = true }
kvm-bindings = { version = "0.11", features = ["fam-wrappers"], optional = true }

[features]
default = ["use_msr", "kvm"]
Expand Down
14 changes: 7 additions & 7 deletions src/bitfield.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl<'a, T: Bindable> Bound<'a, T> {
}
}

impl<'a> fmt::Display for Bound<'a, Flag> {
impl fmt::Display for Bound<'_, Flag> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(
f,
Expand All @@ -152,7 +152,7 @@ impl<'a> fmt::Display for Bound<'a, Flag> {
}
}

impl<'a> fmt::Display for Bound<'a, Int> {
impl fmt::Display for Bound<'_, Int> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(
f,
Expand All @@ -163,7 +163,7 @@ impl<'a> fmt::Display for Bound<'a, Int> {
}
}

impl<'a, B, R, T: From<u32> + From<bool>> Facter<T> for Bound<'a, B>
impl<B, R, T: From<u32> + From<bool>> Facter<T> for Bound<'_, B>
where
R: Default + Into<T>,
B: Bindable<Rep = R>,
Expand All @@ -176,7 +176,7 @@ where
}
}

impl<'a> fmt::Display for Bound<'a, X86Model> {
impl fmt::Display for Bound<'_, X86Model> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(
f,
Expand All @@ -187,7 +187,7 @@ impl<'a> fmt::Display for Bound<'a, X86Model> {
}
}

impl<'a> fmt::Display for Bound<'a, X86Family> {
impl fmt::Display for Bound<'_, X86Family> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(
f,
Expand Down Expand Up @@ -225,7 +225,7 @@ impl<'a> BoundField<'a> {
}
}

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

impl<'a, T: From<bool> + From<u32>> Facter<T> for BoundField<'a> {
impl<T: From<bool> + From<u32>> Facter<T> for BoundField<'_> {
fn collect_fact(&self) -> GenericFact<T> {
match self {
Self::Int(bound) => bound.collect_fact(),
Expand Down
6 changes: 3 additions & 3 deletions src/facts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl<T: PartialEq + Eq + Hash> FactSet<T> {
pub fn added_facts<'to>(
&'to self,
to: &'to Self,
) -> NameIteration<'to, T, impl Iterator<Item = &String>> {
) -> NameIteration<'to, T, impl Iterator<Item = &'to String>> {
let name_iter = to.name_set.difference(&self.name_set);
NameIteration {
iter: name_iter,
Expand All @@ -125,7 +125,7 @@ impl<T: PartialEq + Eq + Hash> FactSet<T> {
pub fn removed_facts<'to>(
&'to self,
to: &'to Self,
) -> NameIteration<'to, T, impl Iterator<Item = &String>> {
) -> NameIteration<'to, T, impl Iterator<Item = &'to String>> {
let name_iter = self.name_set.difference(&to.name_set);
NameIteration {
iter: name_iter,
Expand All @@ -137,7 +137,7 @@ impl<T: PartialEq + Eq + Hash> FactSet<T> {
pub fn changed_facts<'to>(
&'to self,
to: &'to Self,
) -> ChangedIterator<'to, T, impl Iterator<Item = &String>> {
) -> ChangedIterator<'to, T, impl Iterator<Item = &'to String>> {
let name_iter = self.backing.keys();
ChangedIterator {
iter: name_iter,
Expand Down
2 changes: 1 addition & 1 deletion src/kvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::error::Error;
* Other structures such as CPUInfo will then make it accessible like the cpuid function
*/
pub struct KvmInfo {
cpuid_info: kvm_bindings::fam_wrappers::CpuId,
cpuid_info: kvm_bindings::CpuId,
}

impl KvmInfo {
Expand Down
6 changes: 3 additions & 3 deletions src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ pub struct BoundLeaf<'a> {
pub sub_leaves: Vec<CpuidResult>,
}

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

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

impl<'a> fmt::Display for BoundLeaf<'a> {
impl fmt::Display for BoundLeaf<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
self.desc.display_leaf(&self.sub_leaves, f)
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl CpuidDB for RunningCpuidDB {
0..=0x3FFFFFFF => leaf <= self.basic_max,
0x40000000..=0x4fffffff => self
.hypervisor_max
.map_or(false, |max| leaf - 0x40000000 <= max),
.is_some_and(|max| leaf - 0x40000000 <= max),
0x80000000..=0x8fffffff => leaf - 0x80000000 <= self.extended_max,
_ => false,
} {
Expand Down
4 changes: 2 additions & 2 deletions src/msr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub struct MSRValue<'a> {
pub value: u64,
}

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

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