summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2018-12-11 18:48:19 -0800
committerDaniel Mueller <deso@posteo.net>2018-12-11 18:48:19 -0800
commit056e0b6870d646dc6221bea9e47f5afea98647fa (patch)
tree4abbb56e9b2a18b22ba481c3add0b4d0e8f05a56
parent1498caf2f050b0a509689ab6e65a0daac062c76e (diff)
downloadnitrocli-056e0b6870d646dc6221bea9e47f5afea98647fa.tar.gz
nitrocli-056e0b6870d646dc6221bea9e47f5afea98647fa.tar.bz2
Compile program with 2018 Edition of Rust
With the 1.31 release of Rust support for Edition 2018 has reached the stable tool chain. This change enables compilation based off of this new edition for the crate. This change resolves issue #6.
-rw-r--r--nitrocli/CHANGELOG.md1
-rw-r--r--nitrocli/Cargo.toml12
-rw-r--r--nitrocli/src/error.rs2
-rw-r--r--nitrocli/src/main.rs3
4 files changed, 10 insertions, 8 deletions
diff --git a/nitrocli/CHANGELOG.md b/nitrocli/CHANGELOG.md
index 400d265..5340bb4 100644
--- a/nitrocli/CHANGELOG.md
+++ b/nitrocli/CHANGELOG.md
@@ -2,6 +2,7 @@ Unreleased
----------
- Show PIN related errors through `pinentry` native reporting mechanism
instead of emitting them to `stdout`
+- Adjusted program to use Rust Edition 2018
- Applied a couple of `clippy` reported suggestions
- Changed dependency version requirements to be less strict (only up to
the minor version and not the patch level)
diff --git a/nitrocli/Cargo.toml b/nitrocli/Cargo.toml
index b85acef..1d27ee5 100644
--- a/nitrocli/Cargo.toml
+++ b/nitrocli/Cargo.toml
@@ -20,6 +20,7 @@
[package]
name = "nitrocli"
version = "0.1.2"
+edition = "2018"
authors = ["Daniel Mueller <deso@posteo.net>"]
license = "GPL-3.0+"
homepage = "https://github.com/d-e-s-o/nitrocli"
@@ -34,10 +35,6 @@ A command line tool for interacting with the Nitrokey Storage device.
version = "1.0"
path = "../cc"
-[dependencies.hid]
-version = "0.4"
-path = "../hid"
-
[dependencies.hidapi-sys]
version = "0.1"
path = "../hidapi-sys"
@@ -46,13 +43,18 @@ path = "../hidapi-sys"
version = "0.2"
path = "../libc"
+[dependencies.libhid]
+version = "0.4"
+path = "../hid"
+package = "hid"
+
[dependencies.pkg-config]
version = "0.3"
path = "../pkg-config"
[replace]
"cc:1.0.25" = { path = "../cc" }
-"hid:0.4.1" = { path = "../hid" }
"hidapi-sys:0.1.4" = { path = "../hidapi-sys" }
"libc:0.2.45" = { path = "../libc" }
+"libhid:0.4.1" = { path = "../hid" }
"pkg-config:0.3.14" = { path = "../pkg-config" }
diff --git a/nitrocli/src/error.rs b/nitrocli/src/error.rs
index 3d68401..5d6b266 100644
--- a/nitrocli/src/error.rs
+++ b/nitrocli/src/error.rs
@@ -21,6 +21,8 @@ use std::fmt;
use std::io;
use std::string;
+use libhid;
+
#[derive(Debug)]
pub enum Error {
diff --git a/nitrocli/src/main.rs b/nitrocli/src/main.rs
index c598b8d..cfde9bd 100644
--- a/nitrocli/src/main.rs
+++ b/nitrocli/src/main.rs
@@ -26,9 +26,6 @@
//! Nitrocli is a program providing a command line interface to certain
//! commands of the Nitrokey Storage device.
-extern crate hid as libhid;
-
-
mod crc32;
mod error;
mod nitrokey;