diff options
Diffstat (limited to 'src/device.rs')
-rw-r--r-- | src/device.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/device.rs b/src/device.rs index dfc5de1..88be5b5 100644 --- a/src/device.rs +++ b/src/device.rs @@ -634,7 +634,7 @@ fn get_connected_device() -> Option<DeviceWrapper> { get_connected_model().map(create_device_wrapper) } -fn connect_model(model: Model) -> bool { +fn connect_enum(model: Model) -> bool { let model = match model { Model::Storage => nitrokey_sys::NK_device_model_NK_STORAGE, Model::Pro => nitrokey_sys::NK_device_model_NK_PRO, @@ -701,7 +701,7 @@ impl Pro { /// [`Undefined`]: enum.CommandError.html#variant.Undefined pub fn connect() -> Result<Pro, CommandError> { // TODO: maybe Option instead of Result? - match connect_model(Model::Pro) { + match connect_enum(Model::Pro) { true => Ok(Pro {}), false => Err(CommandError::Undefined), } @@ -747,7 +747,7 @@ impl Storage { /// [`Undefined`]: enum.CommandError.html#variant.Undefined pub fn connect() -> Result<Storage, CommandError> { // TODO: maybe Option instead of Result? - match connect_model(Model::Storage) { + match connect_enum(Model::Storage) { true => Ok(Storage {}), false => Err(CommandError::Undefined), } |