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"
|
||||
authors = ["Oliver Hamlet <oliver.hamlet@gmail.com>"]
|
||||
license = "MIT"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
crc = "1.0.0"
|
||||
|
||||
@@ -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
@@ -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
@@ -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]
|
||||
|
||||
@@ -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, &[])
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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
@@ -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";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user