convert comma to dot, remove TODOs
This commit is contained in:
parent
ce8523ea96
commit
d3b52eb29c
@ -1,5 +1,6 @@
|
||||
use std::{fmt, sync::atomic::Ordering};
|
||||
|
||||
use regex::Regex;
|
||||
extern crate serde;
|
||||
extern crate serde_json;
|
||||
extern crate tiny_http;
|
||||
@ -55,7 +56,11 @@ where
|
||||
Err(serde::de::Error::custom("Invalid number format"))
|
||||
}
|
||||
}
|
||||
Value::String(string) => Ok(Some(string)),
|
||||
Value::String(string) => {
|
||||
let re = Regex::new(r"0,([0-9]+)").unwrap();
|
||||
let clean_string = re.replace_all(&string, "0.$1").to_string();
|
||||
Ok(Some(clean_string))
|
||||
}
|
||||
_ => Err(serde::de::Error::custom("Invalid value type")),
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,6 @@ pub fn filter_node(
|
||||
_ => config.text.zmq_stream_socket.clone(),
|
||||
};
|
||||
|
||||
// TODO: in Rust 1.66 use let_chains instead
|
||||
if config.text.text_from_filename && node.is_some() {
|
||||
let source = node.unwrap_or(&Media::new(0, "", false)).source.clone();
|
||||
let text = match Regex::new(&config.text.regex)
|
||||
|
@ -155,8 +155,6 @@ impl SharedLogger for LogMailer {
|
||||
}
|
||||
|
||||
/// Workaround to remove color information from log
|
||||
///
|
||||
/// ToDo: maybe in next version from simplelog this is not necessary anymore.
|
||||
fn clean_string(text: &str) -> String {
|
||||
let regex = Regex::new(r"\x1b\[[0-9;]*[mGKF]").unwrap();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user