From d44f8be7c038bc499b36aa502f4939f41ebebfbf Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sun, 6 Jan 2019 23:17:59 +0000 Subject: Rename device::connect_model to device::connect_enum connect_model will be used for a public function with the next patch. --- src/device.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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 { 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 { // 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 { // TODO: maybe Option instead of Result? - match connect_model(Model::Storage) { + match connect_enum(Model::Storage) { true => Ok(Storage {}), false => Err(CommandError::Undefined), } -- cgit v1.2.3