From 6039e0c76997014ed3f78768f8558da98d373e4b Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sun, 6 Sep 2020 12:57:16 +0200 Subject: Make *Error, Model, DeviceWrapper non-exhaustive Previously, all enums defined by the nitrokey crate were exhaustive. This means that adding new variants to these enums is a breaking change. To make it possible to add new features to nitrokey-rs without breaking compatibility, this patch marks the Error, CommandError, CommunicationError, LibraryError, Model and DeviceWrapper enums as non-exhaustive. --- src/device/mod.rs | 1 + src/device/wrapper.rs | 1 + 2 files changed, 2 insertions(+) (limited to 'src/device') diff --git a/src/device/mod.rs b/src/device/mod.rs index c84faa1..e9018a4 100644 --- a/src/device/mod.rs +++ b/src/device/mod.rs @@ -28,6 +28,7 @@ pub use wrapper::DeviceWrapper; /// Available Nitrokey models. #[derive(Clone, Copy, Debug, PartialEq)] +#[non_exhaustive] pub enum Model { /// The Nitrokey Storage. Storage, diff --git a/src/device/wrapper.rs b/src/device/wrapper.rs index 69291ad..942a905 100644 --- a/src/device/wrapper.rs +++ b/src/device/wrapper.rs @@ -64,6 +64,7 @@ use crate::otp::GenerateOtp; /// /// [`connect`]: struct.Manager.html#method.connect #[derive(Debug)] +#[non_exhaustive] pub enum DeviceWrapper<'a> { /// A Nitrokey Storage device. Storage(Storage<'a>), -- cgit v1.2.1