Update dependencies, remove unneeded keywords and declarations

Also declaration of a lazy_static element was moved in a better spot
This commit is contained in:
Lucien Cartier-Tilet 2020-07-11 17:34:01 +02:00
parent 042fd066f0
commit de45ffc15c
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
5 changed files with 16 additions and 19 deletions

View File

@ -9,11 +9,15 @@ edition = "2018"
[dependencies]
# Logger
log = "0.4"
simplelog = "0.7"
simplelog = "0.8"
# Struct serializing and deserializing
serde = {version = "1.0", features = ["derive"]}
serde_yaml = "0.7"
serde_yaml = "0.8"
serde_json = "1.0"
# Regex support
regex = "1.3"
lazy_static = "1.4.0"
lazy_static = "1.4"
# [dev-dependencies]
# Pretty output
prettydiff = "0.3"

View File

@ -12,12 +12,8 @@
//! [original software](https://github.com/ceronyon/LangEvolve) which applies
//! user-defined sound changes to words and texts based on regex expressions.
#[macro_use]
extern crate lazy_static;
use std::fs::File;
extern crate log;
extern crate simplelog;
use log::{info, warn};
use simplelog::*;

View File

@ -1,13 +1,11 @@
extern crate serde;
extern crate serde_json;
extern crate serde_yaml;
use serde::{Deserialize, Serialize};
extern crate log;
use log::{debug, error, info};
use crate::utils::{self, SettingsType};
use prettydiff::diff_words;
mod rule;
use rule::Rule;

View File

@ -1,13 +1,16 @@
use std::collections::HashMap;
extern crate serde;
extern crate serde_json;
extern crate serde_yaml;
use serde::{Deserialize, Serialize};
use lazy_static::lazy_static;
mod regex_wrapper;
use regex_wrapper::Regex;
lazy_static! {
static ref RE : Regex = Regex::new("%([A-Z])");
}
/// Representation of a rule in LangEvolveRs
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Rule {
@ -34,9 +37,6 @@ impl Rule {
}
fn detect_categories(&self) -> (u8, u8) {
lazy_static! {
static ref RE : Regex = Regex::new("%([A-Z])");
}
let captures_from = match RE.captures(self.from.as_str()) {
None => 0 as u8,
Some(c) => c.len() as u8,

View File

@ -1,4 +1,3 @@
extern crate log;
use log::{info, error};
use std::fs::File;