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

Commit

Permalink
Fixed doctest to ignore on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jennymankin committed Apr 24, 2019
1 parent 960900e commit b7353da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ byteorder = "*"
[target.'cfg(unix)'.dependencies]
kvm-bindings = "0.1"

[target.'cfg(unix)'.dev-dependencies]
kvm-ioctls = "0.1.0"

libc = ">=0.2.39"
27 changes: 13 additions & 14 deletions src/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,20 +197,19 @@ impl CpuId {

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

0 comments on commit b7353da

Please sign in to comment.