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:
2020-07-11 17:34:01 +02:00
parent 042fd066f0
commit de45ffc15c
5 changed files with 16 additions and 19 deletions

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;