From 54af5b5489a3a86e864a11836cff48af15da1f98 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Mon, 10 Dec 2018 22:15:59 -0800 Subject: Enable rust_2018_idioms lint This change enables the rust_2018_idioms lint which helps enforce the usage of Rust 2018 code idioms. A while back the "impl trait" feature stabilized and along with it trait objects are supposed to be prefixed with "dyn". This change adjusts the code accordingly. --- nitrocli/src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'nitrocli/src/main.rs') diff --git a/nitrocli/src/main.rs b/nitrocli/src/main.rs index 67a0a22..c598b8d 100644 --- a/nitrocli/src/main.rs +++ b/nitrocli/src/main.rs @@ -18,7 +18,10 @@ // ************************************************************************* #![deny(missing_docs)] -#![warn(rust_2018_compatibility)] +#![warn( + rust_2018_compatibility, + rust_2018_idioms, +)] //! Nitrocli is a program providing a command line interface to certain //! commands of the Nitrokey Storage device. @@ -40,7 +43,7 @@ use std::time; use crate::error::Error; type Result = result::Result; -type NitroFunc = Fn(&mut libhid::Handle) -> Result<()>; +type NitroFunc = dyn Fn(&mut libhid::Handle) -> Result<()>; const PIN_TYPE: pinentry::PinType = pinentry::PinType::User; -- cgit v1.2.1