mirror of
https://github.com/loot/loot-condition-interpreter.git
synced 2026-07-27 14:16:09 -07:00
Update to Rust 2018 syntax
This commit is contained in:
@@ -3,6 +3,7 @@ name = "loot-condition-interpreter"
|
|||||||
version = "1.3.0"
|
version = "1.3.0"
|
||||||
authors = ["Oliver Hamlet <oliver.hamlet@gmail.com>"]
|
authors = ["Oliver Hamlet <oliver.hamlet@gmail.com>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
crc = "1.0.0"
|
crc = "1.0.0"
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ version = "1.3.0"
|
|||||||
authors = ["Oliver Hamlet <oliver.hamlet@gmail.com>"]
|
authors = ["Oliver Hamlet <oliver.hamlet@gmail.com>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
loot-condition-interpreter = { path = ".." }
|
loot-condition-interpreter = { path = ".." }
|
||||||
|
|||||||
+2
-2
@@ -5,8 +5,8 @@ use libc::{c_char, c_int, size_t};
|
|||||||
use loot_condition_interpreter::{Error, GameType};
|
use loot_condition_interpreter::{Error, GameType};
|
||||||
|
|
||||||
use super::ERROR_MESSAGE;
|
use super::ERROR_MESSAGE;
|
||||||
use constants::*;
|
use crate::constants::*;
|
||||||
use state::{plugin_crc, plugin_version};
|
use crate::state::{plugin_crc, plugin_version};
|
||||||
|
|
||||||
pub fn error(code: c_int, message: &str) -> c_int {
|
pub fn error(code: c_int, message: &str) -> c_int {
|
||||||
ERROR_MESSAGE.with(|f| {
|
ERROR_MESSAGE.with(|f| {
|
||||||
|
|||||||
+4
-2
@@ -6,8 +6,10 @@ use std::sync::RwLock;
|
|||||||
use libc::{c_char, c_int, size_t};
|
use libc::{c_char, c_int, size_t};
|
||||||
use loot_condition_interpreter::State;
|
use loot_condition_interpreter::State;
|
||||||
|
|
||||||
use constants::*;
|
use crate::constants::*;
|
||||||
use helpers::{error, map_game_type, map_plugin_crcs, map_plugin_versions, to_str, to_str_vec};
|
use crate::helpers::{
|
||||||
|
error, map_game_type, map_plugin_crcs, map_plugin_versions, to_str, to_str_vec,
|
||||||
|
};
|
||||||
|
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
|||||||
@@ -8,9 +8,8 @@ use crc::{crc32, Hasher32};
|
|||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
|
||||||
use super::{ComparisonOperator, Function};
|
use super::{ComparisonOperator, Function};
|
||||||
use version::Version;
|
use crate::version::Version;
|
||||||
use Error;
|
use crate::{Error, State};
|
||||||
use State;
|
|
||||||
|
|
||||||
fn add_extension(path: &Path, extension: &str) -> PathBuf {
|
fn add_extension(path: &Path, extension: &str) -> PathBuf {
|
||||||
match path.extension() {
|
match path.extension() {
|
||||||
@@ -274,7 +273,7 @@ mod tests {
|
|||||||
use regex::RegexBuilder;
|
use regex::RegexBuilder;
|
||||||
use tempfile::tempdir;
|
use tempfile::tempdir;
|
||||||
|
|
||||||
use GameType;
|
use crate::GameType;
|
||||||
|
|
||||||
fn state<T: Into<PathBuf>>(data_path: T) -> State {
|
fn state<T: Into<PathBuf>>(data_path: T) -> State {
|
||||||
state_with_active_plugins(data_path, &[])
|
state_with_active_plugins(data_path, &[])
|
||||||
|
|||||||
@@ -10,10 +10,8 @@ use nom::{Err, IResult};
|
|||||||
use regex::{Regex, RegexBuilder};
|
use regex::{Regex, RegexBuilder};
|
||||||
|
|
||||||
use super::{ComparisonOperator, Function};
|
use super::{ComparisonOperator, Function};
|
||||||
use crate::{map_err, whitespace};
|
use crate::error::ParsingErrorKind;
|
||||||
use error::ParsingErrorKind;
|
use crate::{map_err, whitespace, ParsingError, ParsingResult};
|
||||||
use ParsingError;
|
|
||||||
use ParsingResult;
|
|
||||||
|
|
||||||
impl ComparisonOperator {
|
impl ComparisonOperator {
|
||||||
pub fn parse(input: &str) -> IResult<&str, ComparisonOperator> {
|
pub fn parse(input: &str) -> IResult<&str, ComparisonOperator> {
|
||||||
|
|||||||
@@ -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 error;
|
||||||
mod function;
|
mod function;
|
||||||
mod version;
|
mod version;
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ use pelite::resources::version_info::VersionInfo;
|
|||||||
use pelite::resources::{FindError, Resources};
|
use pelite::resources::{FindError, Resources};
|
||||||
use pelite::FileMap;
|
use pelite::FileMap;
|
||||||
|
|
||||||
use error::Error;
|
use crate::error::Error;
|
||||||
|
|
||||||
const VERSION_INFO_RESOURCE_PATH: &str = "/16/1";
|
const VERSION_INFO_RESOURCE_PATH: &str = "/16/1";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user