Skip to content

Commit 465b143

Browse files
committed
Make HidDevice cloneable for easier API
1 parent 7efdc93 commit 465b143

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libwebauthn/src/transport/hid/device.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ use crate::transport::error::{Error, TransportError};
1616
use crate::transport::Device;
1717
use crate::UxUpdate;
1818

19-
#[derive(Debug)]
19+
#[derive(Debug, Clone)]
2020
pub struct HidDevice {
2121
pub backend: HidBackendDevice,
2222
}
2323

2424
#[derive(Debug)]
25+
// SoloVirtualKey is not clone-able, but in test-mode we don't care
26+
#[cfg_attr(not(feature = "virtual-hid-device"), derive(Clone))]
2527
pub enum HidBackendDevice {
2628
HidApiDevice(DeviceInfo),
2729
#[cfg(feature = "virtual-hid-device")]

0 commit comments

Comments
 (0)