From 0f163477f63d533f90b61c1f39423712567bf7ea Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sat, 25 Jan 2020 21:07:07 +0100 Subject: 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. --- src/main.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main.rs') 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, -- cgit v1.2.3