Skip to content

Commit baa7004

Browse files
00xcJonathanWoollett-Light
authored andcommitted
Add missing Copy derives
Add free Copy derives where possible. Add a lint to prevent future additions of types that do not derive Copy where possible. Signed-off-by: Carlos López <[email protected]>
1 parent 7dda0d0 commit baa7004

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
## Changed
66
- [[#234](https://github.com/rust-vmm/kvm-ioctls/issues/234)] vcpu: export
77
reg_size as a public method.
8+
-[[#243](https://github.com/rust-vmm/kvm-ioctls/pull/243)] derived the `Copy`
9+
trait for `IoEventAddress` and `NoDatamatch`.
810

911
# v0.15.0
1012

src/ioctls/vm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use vmm_sys_util::ioctl::{ioctl, ioctl_with_mut_ref, ioctl_with_ref, ioctl_with_
2828
///
2929
/// The `IoEventAddress` is used for specifying the type when registering an event
3030
/// in [register_ioevent](struct.VmFd.html#method.register_ioevent).
31-
#[derive(Debug)]
31+
#[derive(Debug, Clone, Copy)]
3232
pub enum IoEventAddress {
3333
/// Representation of an programmable I/O address.
3434
Pio(u64),
@@ -42,7 +42,7 @@ pub enum IoEventAddress {
4242
/// [`register_ioevent`](struct.VmFd.html#method.register_ioevent)
4343
/// to disable filtering of events based on the datamatch flag. For details check the
4444
/// [KVM API documentation](https://www.kernel.org/doc/Documentation/virtual/kvm/api.txt).
45-
#[derive(Debug)]
45+
#[derive(Debug, Clone, Copy)]
4646
pub struct NoDatamatch;
4747
impl From<NoDatamatch> for u64 {
4848
fn from(_: NoDatamatch) -> u64 {

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// Use of this source code is governed by a BSD-style license that can be
66
// found in the THIRD-PARTY file.
77
#![deny(missing_docs)]
8+
#![deny(missing_copy_implementations)]
89

910
//! A safe wrapper around the kernel's KVM interface.
1011
//!

0 commit comments

Comments
 (0)