aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2019-01-06 23:17:59 +0000
committerRobin Krahl <robin.krahl@ireas.org>2019-01-07 00:29:37 +0100
commitd44f8be7c038bc499b36aa502f4939f41ebebfbf (patch)
tree7f97ef91e95f00a10f6add613336c39ddf93e51a /src
parent9015fcd2593467af128ca4114c3ff02952d1c93b (diff)
downloadnitrokey-rs-d44f8be7c038bc499b36aa502f4939f41ebebfbf.tar.gz
nitrokey-rs-d44f8be7c038bc499b36aa502f4939f41ebebfbf.tar.bz2
Rename device::connect_model to device::connect_enum
connect_model will be used for a public function with the next patch.
Diffstat (limited to 'src')
-rw-r--r--src/device.rs6
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),
}