diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2018-12-16 12:29:08 +0100 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2018-12-16 12:29:08 +0100 |
commit | b552a92bcc6ffd59b5b780b12cab4a25aa5812d2 (patch) | |
tree | e0d9c4fb17c14aba407d6fb165dda0922d4bd7c9 /src | |
parent | 048d4fa5529bf33e21f11873792cdacfcaf7793f (diff) | |
download | nitrokey-rs-b552a92bcc6ffd59b5b780b12cab4a25aa5812d2.tar.gz nitrokey-rs-b552a92bcc6ffd59b5b780b12cab4a25aa5812d2.tar.bz2 |
Use the crate:: path qualifier for modules
This patch changes use declarations for modules within this crate to use
the crate:: path qualifier. This will be mandatory in Rust edition
2018.
Diffstat (limited to 'src')
-rw-r--r-- | src/auth.rs | 12 | ||||
-rw-r--r-- | src/config.rs | 2 | ||||
-rw-r--r-- | src/device.rs | 11 | ||||
-rw-r--r-- | src/lib.rs | 12 | ||||
-rw-r--r-- | src/otp.rs | 6 | ||||
-rw-r--r-- | src/pws.rs | 5 |
6 files changed, 27 insertions, 21 deletions
diff --git a/src/auth.rs b/src/auth.rs index 0918222..ef39777 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -1,10 +1,12 @@ -use config::{Config, RawConfig}; -use device::{Device, DeviceWrapper, Pro, Storage}; -use nitrokey_sys; -use otp::{ConfigureOtp, GenerateOtp, OtpMode, OtpSlotData, RawOtpSlotData}; use std::ops::Deref; use std::os::raw::c_int; -use util::{generate_password, get_command_result, get_cstring, result_from_string, CommandError}; + +use nitrokey_sys; + +use crate::config::{Config, RawConfig}; +use crate::device::{Device, DeviceWrapper, Pro, Storage}; +use crate::otp::{ConfigureOtp, GenerateOtp, OtpMode, OtpSlotData, RawOtpSlotData}; +use crate::util::{generate_password, get_command_result, get_cstring, result_from_string, CommandError}; static TEMPORARY_PASSWORD_LENGTH: usize = 25; diff --git a/src/config.rs b/src/config.rs index 33bf256..2ce6f77 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,4 +1,4 @@ -use util::CommandError; +use crate::util::CommandError; /// The configuration for a Nitrokey. #[derive(Clone, Copy, Debug, PartialEq)] diff --git a/src/device.rs b/src/device.rs index cbc826e..86dcc58 100644 --- a/src/device.rs +++ b/src/device.rs @@ -1,10 +1,11 @@ -use auth::Authenticate; -use config::{Config, RawConfig}; use libc; use nitrokey_sys; -use otp::GenerateOtp; -use pws::GetPasswordSafe; -use util::{get_command_result, get_cstring, get_last_error, result_from_string, CommandError}; + +use crate::auth::Authenticate; +use crate::config::{Config, RawConfig}; +use crate::otp::GenerateOtp; +use crate::pws::GetPasswordSafe; +use crate::util::{get_command_result, get_cstring, get_last_error, result_from_string, CommandError}; /// Available Nitrokey models. #[derive(Debug, PartialEq)] @@ -104,12 +104,12 @@ mod pws; mod tests; mod util; -pub use auth::{Admin, Authenticate, User}; -pub use config::Config; -pub use device::{connect, Device, DeviceWrapper, Pro, Storage, StorageStatus, VolumeStatus}; -pub use otp::{ConfigureOtp, GenerateOtp, OtpMode, OtpSlotData}; -pub use pws::{GetPasswordSafe, PasswordSafe, SLOT_COUNT}; -pub use util::{CommandError, LogLevel}; +pub use crate::auth::{Admin, Authenticate, User}; +pub use crate::config::Config; +pub use crate::device::{connect, Device, DeviceWrapper, Pro, Storage, StorageStatus, VolumeStatus}; +pub use crate::otp::{ConfigureOtp, GenerateOtp, OtpMode, OtpSlotData}; +pub use crate::pws::{GetPasswordSafe, PasswordSafe, SLOT_COUNT}; +pub use crate::util::{CommandError, LogLevel}; /// Enables or disables debug output. Calling this method with `true` is equivalent to setting the /// log level to `Debug`; calling it with `false` is equivalent to the log level `Error` (see @@ -1,6 +1,8 @@ -use nitrokey_sys; use std::ffi::CString; -use util::{get_command_result, get_cstring, result_from_string, CommandError}; + +use nitrokey_sys; + +use crate::util::{get_command_result, get_cstring, result_from_string, CommandError}; /// Modes for one-time password generation. #[derive(Debug, PartialEq)] @@ -1,7 +1,8 @@ -use device::{Device, DeviceWrapper, Pro, Storage}; use libc; use nitrokey_sys; -use util::{get_command_result, get_cstring, get_last_error, result_from_string, CommandError}; + +use crate::device::{Device, DeviceWrapper, Pro, Storage}; +use crate::util::{get_command_result, get_cstring, get_last_error, result_from_string, CommandError}; /// The number of slots in a [`PasswordSafe`][]. /// |