Skip to content

Commit 5ff0a25

Browse files
roypatShadowCurse
authored andcommitted
doc(system): Minor doc-comment fixes
- Convert `assert!(... == ...)` to `assert_eq!` - Drop unneeded `any` inside cfgs if the `any` only contains a single condition. Signed-off-by: Patrick Roy <[email protected]>
1 parent b32d48c commit 5ff0a25

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ioctls/system.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ impl Kvm {
556556
/// // Check that the VM mmap size is the same reported by `KVM_GET_VCPU_MMAP_SIZE`.
557557
/// assert!(vm.run_size() == kvm.get_vcpu_mmap_size().unwrap());
558558
/// ```
559-
#[cfg(not(any(target_arch = "aarch64")))]
559+
#[cfg(not(target_arch = "aarch64"))]
560560
pub fn create_vm(&self) -> Result<VmFd> {
561561
self.create_vm_with_type(0) // Create using default VM type
562562
}
@@ -574,7 +574,7 @@ impl Kvm {
574574
/// let kvm = Kvm::new().unwrap();
575575
/// let vm = kvm.create_vm().unwrap();
576576
/// // Check that the VM mmap size is the same reported by `KVM_GET_VCPU_MMAP_SIZE`.
577-
/// assert!(vm.run_size() == kvm.get_vcpu_mmap_size().unwrap());
577+
/// assert_eq!(vm.run_size(), kvm.get_vcpu_mmap_size().unwrap());
578578
/// ```
579579
#[cfg(target_arch = "aarch64")]
580580
pub fn create_vm(&self) -> Result<VmFd> {
@@ -612,7 +612,7 @@ impl Kvm {
612612
/// let host_ipa_limit = kvm.get_host_ipa_limit();
613613
/// let vm = kvm.create_vm_with_ipa_size(host_ipa_limit as u32).unwrap();
614614
/// // Check that the VM mmap size is the same reported by `KVM_GET_VCPU_MMAP_SIZE`.
615-
/// assert!(vm.run_size() == kvm.get_vcpu_mmap_size().unwrap());
615+
/// assert_eq!(vm.run_size(), kvm.get_vcpu_mmap_size().unwrap());
616616
/// }
617617
/// ```
618618
#[cfg(target_arch = "aarch64")]
@@ -635,7 +635,7 @@ impl Kvm {
635635
/// let kvm = Kvm::new().unwrap();
636636
/// let vm = kvm.create_vm_with_type(0).unwrap();
637637
/// // Check that the VM mmap size is the same reported by `KVM_GET_VCPU_MMAP_SIZE`.
638-
/// assert!(vm.run_size() == kvm.get_vcpu_mmap_size().unwrap());
638+
/// assert_eq!(vm.run_size(), kvm.get_vcpu_mmap_size().unwrap());
639639
/// ```
640640
pub fn create_vm_with_type(&self, vm_type: u64) -> Result<VmFd> {
641641
// SAFETY: Safe because we know `self.kvm` is a real KVM fd as this module is the only one

0 commit comments

Comments
 (0)