Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.

Commit b7353da

Browse files
committed
Fixed doctest to ignore on Windows
1 parent 960900e commit b7353da

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ byteorder = "*"
1515
[target.'cfg(unix)'.dependencies]
1616
kvm-bindings = "0.1"
1717

18+
[target.'cfg(unix)'.dev-dependencies]
19+
kvm-ioctls = "0.1.0"
20+
1821
libc = ">=0.2.39"

src/x86_64/mod.rs

+13-14
Original file line numberDiff line numberDiff line change
@@ -197,20 +197,19 @@ impl CpuId {
197197

198198
/// Returns the mutable entries slice so they can be modified before passing to the VCPU.
199199
///
200-
// Example:
201-
// NOTE: Example is KVM-specific and thus not going to run on all platforms
202-
// (and doc-comment examples do not yet support conditional compilation), so
203-
// the example is left as a regular comment.
204-
//
205-
// ```rust
206-
// # extern crate kvm_ioctls;
207-
//
208-
// use kvm_ioctls::Kvm;
209-
// use vmm_vcpu::x86_64::{CpuId, MAX_CPUID_ENTRIES};
210-
// let kvm = Kvm::new().unwrap();
211-
// let mut cpuid = kvm.get_supported_cpuid(MAX_KVM_CPUID_ENTRIES).unwrap();
212-
// let cpuid_entries = cpuid.mut_entries_slice();
213-
// ```
200+
/// ```cfg(unix)
201+
/// extern crate kvm_ioctls;
202+
///
203+
/// use kvm_ioctls::Kvm;
204+
/// use vmm_vcpu::x86_64::{CpuId, MAX_CPUID_ENTRIES};
205+
///
206+
/// # fn main() {
207+
/// let kvm = Kvm::new().unwrap();
208+
/// let mut cpuid = kvm.get_supported_cpuid(MAX_CPUID_ENTRIES).unwrap();
209+
/// let cpuid_entries = cpuid.mut_entries_slice();
210+
/// # }
211+
///
212+
/// ```
214213
///
215214
pub fn mut_entries_slice(&mut self) -> &mut [CpuIdEntry2] {
216215
// Mapping the unsized array to a slice is unsafe because the length isn't known. Using

0 commit comments

Comments
 (0)