Remove lazy_static

we don't need lazy static here, so remove it and the dependency as well.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
Matthias Beyer 2019-05-19 09:14:09 +02:00
parent ed457495c8
commit 5ff2c3e8e3
3 changed files with 5 additions and 9 deletions

View file

@ -22,7 +22,6 @@ maintenance = { status = "actively-developed" }
[dependencies]
chrono = "0.4"
toml-query = "0.8"
lazy_static = "1.2"
toml = "0.4"
failure = "0.1"

View file

@ -44,12 +44,10 @@ pub trait EntryDate {
}
lazy_static! {
static ref DATE_HEADER_LOCATION : &'static str = "datetime.value";
static ref DATE_RANGE_START_HEADER_LOCATION : &'static str = "datetime.range.start";
static ref DATE_RANGE_END_HEADER_LOCATION : &'static str = "datetime.range.end";
static ref DATE_FMT : &'static str = "%Y-%m-%dT%H:%M:%S";
}
const DATE_HEADER_LOCATION : &'static str = "datetime.value";
const DATE_RANGE_START_HEADER_LOCATION : &'static str = "datetime.range.start";
const DATE_RANGE_END_HEADER_LOCATION : &'static str = "datetime.range.end";
const DATE_FMT : &'static str = "%Y-%m-%dT%H:%M:%S";
impl EntryDate for Entry {
@ -93,7 +91,7 @@ impl EntryDate for Entry {
self.get_header_mut()
.insert(&DATE_HEADER_LOCATION, Value::String(date))
.context(format_err!("Failed to insert header '{}' in '{}'",
*DATE_HEADER_LOCATION,
DATE_HEADER_LOCATION,
self.get_location()))
.map_err(Error::from)
.map(|opt| opt.map(|stri| {

View file

@ -37,7 +37,6 @@
while_true,
)]
#[macro_use] extern crate lazy_static;
#[macro_use] extern crate failure;
extern crate chrono;
extern crate toml_query;