Update to Rust 2018 syntax

This commit is contained in:
Oliver Hamlet
2019-06-30 11:25:23 +01:00
parent 6cfefc6c31
commit 52792626af
8 changed files with 14 additions and 22 deletions
+1
View File
@@ -3,6 +3,7 @@ name = "loot-condition-interpreter"
version = "1.3.0"
authors = ["Oliver Hamlet <oliver.hamlet@gmail.com>"]
license = "MIT"
edition = "2018"
[dependencies]
crc = "1.0.0"
+1
View File
@@ -4,6 +4,7 @@ version = "1.3.0"
authors = ["Oliver Hamlet <oliver.hamlet@gmail.com>"]
license = "MIT"
build = "build.rs"
edition = "2018"
[dependencies]
loot-condition-interpreter = { path = ".." }
+2 -2
View File
@@ -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| {
+4 -2
View File
@@ -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]
+3 -4
View File
@@ -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<T: Into<PathBuf>>(data_path: T) -> State {
state_with_active_plugins(data_path, &[])
+2 -4
View File
@@ -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> {
-9
View File
@@ -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;
+1 -1
View File
@@ -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";