diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2020-01-25 21:07:07 +0100 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2021-01-10 17:37:55 -0800 |
commit | 0f163477f63d533f90b61c1f39423712567bf7ea (patch) | |
tree | f8bac7008f382e9b0dd425ed75422e9a9af7938f /src/main.rs | |
parent | 0cc4371d138d5e98cd22813f10689cb089eef378 (diff) | |
download | nitrocli-0f163477f63d533f90b61c1f39423712567bf7ea.tar.gz nitrocli-0f163477f63d533f90b61c1f39423712567bf7ea.tar.bz2 |
Refactor connection handling
This patch introduces two new functions, find_device and connect, to
connect to a Nitrokey device. find_device queries the attached Nitrokey
devices, applies the filters (currently only the --model option) and
returns the first match. connect calls find_device and connects to the
returned device.
This refactoring allows us to add more device filters, for example a
--serial-number option, without code duplication.
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index baad15c..16715f9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,7 @@ // Copyright (C) 2017-2020 The Nitrocli Developers // SPDX-License-Identifier: GPL-3.0-or-later +#![allow(clippy::trivially_copy_pass_by_ref)] #![warn( bad_style, dead_code, |