summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvans Murithi <murithievans80@gmail.com>2022-01-09 19:39:28 +0300
committerGitHub <noreply@github.com>2022-01-09 19:39:28 +0300
commita1c64478d20d5499b67469bac1a0410fc0ea67a8 (patch)
tree3b1eab237d7fb7e04c5872a24731ade6ef4bea90
parentff7b06d51f9ac748270e71f1d5774951aef83e6a (diff)
parent993394fbf1172b0f8bf85b0bfd2de95202d3ea97 (diff)
Merge pull request #208 from evansmurithi/edition-2018-migration
Migrate to 2018 edition
-rw-r--r--Cargo.toml1
-rw-r--r--src/account.rs5
-rw-r--r--src/cmd/add.rs2
-rw-r--r--src/cmd/delete.rs2
-rw-r--r--src/cmd/list.rs4
-rw-r--r--src/cmd/view.rs4
-rw-r--r--src/dirs.rs3
-rw-r--r--src/main.rs2
-rw-r--r--src/otp.rs2
9 files changed, 12 insertions, 13 deletions
diff --git a/Cargo.toml b/Cargo.toml
index f54fca4..89a8484 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,6 +10,7 @@ keywords = ["otp", "cli", "authentication"]
categories = ["command-line-utilities", "authentication"]
license = "MIT"
description = "A Command Line OTP (One Time Password) Authenticator application."
+edition = "2018"
[dependencies]
clap = { version = "3.0.4", features = ["cargo", "wrap_help"] }
diff --git a/src/account.rs b/src/account.rs
index 57ec466..bcaafc6 100644
--- a/src/account.rs
+++ b/src/account.rs
@@ -1,8 +1,7 @@
-use dirs::CLOAK_ACCOUNTS_FILE_PATH;
-use errors::Result;
+use crate::dirs::CLOAK_ACCOUNTS_FILE_PATH;
+use crate::errors::Result;
use std::collections::BTreeMap;
use std::fs;
-use toml;
#[derive(Debug, Deserialize, Serialize)]
pub struct Account {
diff --git a/src/cmd/add.rs b/src/cmd/add.rs
index 421ea71..4c227dc 100644
--- a/src/cmd/add.rs
+++ b/src/cmd/add.rs
@@ -1,4 +1,4 @@
-use account::{Account, AccountStore};
+use crate::account::{Account, AccountStore};
use clap::{App, Arg, ArgMatches};
use data_encoding::BASE32_NOPAD;
diff --git a/src/cmd/delete.rs b/src/cmd/delete.rs
index 0aebc67..80128c4 100644
--- a/src/cmd/delete.rs
+++ b/src/cmd/delete.rs
@@ -1,4 +1,4 @@
-use account::AccountStore;
+use crate::account::AccountStore;
use clap::{App, Arg, ArgMatches};
use std::io::{self, Write};
diff --git a/src/cmd/list.rs b/src/cmd/list.rs
index 96caafe..3aa5ce1 100644
--- a/src/cmd/list.rs
+++ b/src/cmd/list.rs
@@ -1,6 +1,6 @@
-use account::AccountStore;
+use crate::account::AccountStore;
+use crate::otp::OneTimePassword;
use clap::App;
-use otp::OneTimePassword;
// `list` subcommand
pub fn subcommand<'a>() -> App<'a> {
diff --git a/src/cmd/view.rs b/src/cmd/view.rs
index b8ba9f5..03e088b 100644
--- a/src/cmd/view.rs
+++ b/src/cmd/view.rs
@@ -1,6 +1,6 @@
-use account::AccountStore;
+use crate::account::AccountStore;
+use crate::otp::OneTimePassword;
use clap::{App, Arg, ArgMatches};
-use otp::OneTimePassword;
// Create arguments for `view` subcommand
pub fn subcommand<'a>() -> App<'a> {
diff --git a/src/dirs.rs b/src/dirs.rs
index 9a26535..9305322 100644
--- a/src/dirs.rs
+++ b/src/dirs.rs
@@ -1,5 +1,4 @@
-use dirs_next;
-use errors::{Error, Result};
+use crate::errors::{Error, Result};
use std::env;
use std::fs;
use std::path::{Path, PathBuf};
diff --git a/src/main.rs b/src/main.rs
index 36f4521..f98d7bb 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -10,7 +10,7 @@ extern crate toml;
#[macro_use]
extern crate lazy_static;
-use account::AccountStore;
+use crate::account::AccountStore;
use clap::app_from_crate;
mod account;
diff --git a/src/otp.rs b/src/otp.rs
index 0c0a1ff..39474e8 100644
--- a/src/otp.rs
+++ b/src/otp.rs
@@ -1,5 +1,5 @@
+use crate::errors::{Error, Result};
use data_encoding::BASE32_NOPAD;
-use errors::{Error, Result};
use ring::hmac;
use std::time::{SystemTime, UNIX_EPOCH};