diff --git a/Cargo.toml b/Cargo.toml index 53354d6..649f00b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ name = "loot-condition-interpreter" version = "1.3.0" authors = ["Oliver Hamlet "] license = "MIT" +edition = "2018" [dependencies] crc = "1.0.0" diff --git a/ffi/Cargo.toml b/ffi/Cargo.toml index c5d8564..f39c25f 100644 --- a/ffi/Cargo.toml +++ b/ffi/Cargo.toml @@ -4,6 +4,7 @@ version = "1.3.0" authors = ["Oliver Hamlet "] license = "MIT" build = "build.rs" +edition = "2018" [dependencies] loot-condition-interpreter = { path = ".." } diff --git a/ffi/src/helpers.rs b/ffi/src/helpers.rs index 9849d4a..333225a 100644 --- a/ffi/src/helpers.rs +++ b/ffi/src/helpers.rs @@ -5,8 +5,8 @@ use libc::{c_char, c_int, size_t}; use loot_condition_interpreter::{Error, GameType}; use super::ERROR_MESSAGE; -use constants::*; -use state::{plugin_crc, plugin_version}; +use crate::constants::*; +use crate::state::{plugin_crc, plugin_version}; pub fn error(code: c_int, message: &str) -> c_int { ERROR_MESSAGE.with(|f| { diff --git a/ffi/src/state.rs b/ffi/src/state.rs index 6d9dc57..890ddeb 100644 --- a/ffi/src/state.rs +++ b/ffi/src/state.rs @@ -6,8 +6,10 @@ use std::sync::RwLock; use libc::{c_char, c_int, size_t}; use loot_condition_interpreter::State; -use constants::*; -use helpers::{error, map_game_type, map_plugin_crcs, map_plugin_versions, to_str, to_str_vec}; +use crate::constants::*; +use crate::helpers::{ + error, map_game_type, map_plugin_crcs, map_plugin_versions, to_str, to_str_vec, +}; #[allow(non_camel_case_types)] #[no_mangle] diff --git a/src/function/eval.rs b/src/function/eval.rs index 1b86f15..f1f075e 100644 --- a/src/function/eval.rs +++ b/src/function/eval.rs @@ -8,9 +8,8 @@ use crc::{crc32, Hasher32}; use regex::Regex; use super::{ComparisonOperator, Function}; -use version::Version; -use Error; -use State; +use crate::version::Version; +use crate::{Error, State}; fn add_extension(path: &Path, extension: &str) -> PathBuf { match path.extension() { @@ -274,7 +273,7 @@ mod tests { use regex::RegexBuilder; use tempfile::tempdir; - use GameType; + use crate::GameType; fn state>(data_path: T) -> State { state_with_active_plugins(data_path, &[]) diff --git a/src/function/parse.rs b/src/function/parse.rs index c0a22ba..1eda2a1 100644 --- a/src/function/parse.rs +++ b/src/function/parse.rs @@ -10,10 +10,8 @@ use nom::{Err, IResult}; use regex::{Regex, RegexBuilder}; use super::{ComparisonOperator, Function}; -use crate::{map_err, whitespace}; -use error::ParsingErrorKind; -use ParsingError; -use ParsingResult; +use crate::error::ParsingErrorKind; +use crate::{map_err, whitespace, ParsingError, ParsingResult}; impl ComparisonOperator { pub fn parse(input: &str) -> IResult<&str, ComparisonOperator> { diff --git a/src/lib.rs b/src/lib.rs index 37ba4b7..9a3250f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,12 +1,3 @@ -extern crate crc; -extern crate nom; -extern crate pelite; -extern crate regex; -extern crate unicase; - -#[cfg(test)] -extern crate tempfile; - mod error; mod function; mod version; diff --git a/src/version.rs b/src/version.rs index 56d8974..24b9811 100644 --- a/src/version.rs +++ b/src/version.rs @@ -5,7 +5,7 @@ use pelite::resources::version_info::VersionInfo; use pelite::resources::{FindError, Resources}; use pelite::FileMap; -use error::Error; +use crate::error::Error; const VERSION_INFO_RESOURCE_PATH: &str = "/16/1";