diff --git a/Cargo.lock b/Cargo.lock index cf90565..2d1d9c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "anstream" @@ -194,18 +194,18 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "kvm-bindings" -version = "0.8.1" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82e7e8725a39a0015e511a46cc1f7d90cecc180db1610c4d0d4339a9e48bd21" +checksum = "3b13baf7bdfda2e10bcb109fcb099ef40cff82374eb6b7cdcf4695bdec4e522c" dependencies = [ "vmm-sys-util", ] [[package]] name = "kvm-ioctls" -version = "0.17.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bedae2ca4a531bebe311abaf9691f5cc14eaa21475243caa2e39c43bb872947d" +checksum = "083c460d5a272c2f22205973e319147b791d92a288d7d7a8d4c6194f95229440" dependencies = [ "bitflags 2.5.0", "kvm-bindings", diff --git a/Cargo.toml b/Cargo.toml index 26a39d8..3fbfdc0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"] diff --git a/src/bitfield.rs b/src/bitfield.rs index 9414031..ff5030a 100644 --- a/src/bitfield.rs +++ b/src/bitfield.rs @@ -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, @@ -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, @@ -163,7 +163,7 @@ impl<'a> fmt::Display for Bound<'a, Int> { } } -impl<'a, B, R, T: From + From> Facter for Bound<'a, B> +impl + From> Facter for Bound<'_, B> where R: Default + Into, B: Bindable, @@ -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, @@ -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, @@ -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), @@ -236,7 +236,7 @@ impl<'a> fmt::Display for BoundField<'a> { } } -impl<'a, T: From + From> Facter for BoundField<'a> { +impl + From> Facter for BoundField<'_> { fn collect_fact(&self) -> GenericFact { match self { Self::Int(bound) => bound.collect_fact(), diff --git a/src/facts.rs b/src/facts.rs index d14d00c..0f03637 100644 --- a/src/facts.rs +++ b/src/facts.rs @@ -113,7 +113,7 @@ impl FactSet { pub fn added_facts<'to>( &'to self, to: &'to Self, - ) -> NameIteration<'to, T, impl Iterator> { + ) -> NameIteration<'to, T, impl Iterator> { let name_iter = to.name_set.difference(&self.name_set); NameIteration { iter: name_iter, @@ -125,7 +125,7 @@ impl FactSet { pub fn removed_facts<'to>( &'to self, to: &'to Self, - ) -> NameIteration<'to, T, impl Iterator> { + ) -> NameIteration<'to, T, impl Iterator> { let name_iter = self.name_set.difference(&to.name_set); NameIteration { iter: name_iter, @@ -137,7 +137,7 @@ impl FactSet { pub fn changed_facts<'to>( &'to self, to: &'to Self, - ) -> ChangedIterator<'to, T, impl Iterator> { + ) -> ChangedIterator<'to, T, impl Iterator> { let name_iter = self.backing.keys(); ChangedIterator { iter: name_iter, diff --git a/src/kvm.rs b/src/kvm.rs index 0772193..1b47618 100644 --- a/src/kvm.rs +++ b/src/kvm.rs @@ -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 { diff --git a/src/layout.rs b/src/layout.rs index 278014e..e6c0fb2 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -335,7 +335,7 @@ pub struct BoundLeaf<'a> { pub sub_leaves: Vec, } -impl<'a> BoundLeaf<'a> { +impl BoundLeaf<'_> { pub fn get_facts + From + From>(&self) -> Vec> { let mut facts = self.desc.get_facts(&self.sub_leaves); facts.iter_mut().for_each(|i| { @@ -345,13 +345,13 @@ impl<'a> BoundLeaf<'a> { } } -impl<'a, T: From + From + From> facts::Facter> for BoundLeaf<'a> { +impl + From + From> facts::Facter> for BoundLeaf<'_> { fn collect_facts(&self) -> Vec> { 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) } diff --git a/src/lib.rs b/src/lib.rs index e0156bf..e7c3e16 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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, } { diff --git a/src/msr.rs b/src/msr.rs index 41e598e..2a2cfb0 100644 --- a/src/msr.rs +++ b/src/msr.rs @@ -114,7 +114,7 @@ pub struct MSRValue<'a> { pub value: u64, } -impl<'a, T: From + From + From> facts::Facter> for MSRValue<'a> { +impl + From + From> facts::Facter> for MSRValue<'_> { fn collect_facts(&self) -> Vec> { let value = self.value.into(); self.desc @@ -130,7 +130,7 @@ impl<'a, T: From + From + From> facts::Facter> } } -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 {