summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2018-12-10 22:15:59 -0800
committerDaniel Mueller <deso@posteo.net>2018-12-10 22:15:59 -0800
commit54af5b5489a3a86e864a11836cff48af15da1f98 (patch)
tree68bad33ddc3d75e4dad2a41fb61cef361c99a793
parent0b18dd976269b09d3d44208eaab0000ddfebaf93 (diff)
downloadnitrocli-54af5b5489a3a86e864a11836cff48af15da1f98.tar.gz
nitrocli-54af5b5489a3a86e864a11836cff48af15da1f98.tar.bz2
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.
-rw-r--r--nitrocli/src/main.rs7
1 files changed, 5 insertions, 2 deletions
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<T> = result::Result<T, Error>;
-type NitroFunc = Fn(&mut libhid::Handle) -> Result<()>;
+type NitroFunc = dyn Fn(&mut libhid::Handle) -> Result<()>;
const PIN_TYPE: pinentry::PinType = pinentry::PinType::User;