summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorBen S <ogham@bsago.me>2015-11-15 19:26:58 +0000
committerBen S <ogham@bsago.me>2015-11-15 19:26:58 +0000
commite07992d08c22898ca723fcb2383c545226d360ce (patch)
tree484110571b81bd627914cfaa0d2c03a0320ab625 /src/main.rs
parent021655faecc24b4845afebb7cd61b3d1466a12c7 (diff)
Use lazy_static to cache datetime formats
One of those two date formats was re-compiled before any date was displayed. Now they are compiled only the first time they're used, and cached versions are used thereafter, resulting in a speedup.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 8c4761a..1e9f76c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,5 +1,5 @@
#![warn(trivial_casts, trivial_numeric_casts)]
-#![warn(unused_extern_crates, unused_qualifications)]
+#![warn(unused_qualifications)]
#![warn(unused_results)]
extern crate ansi_term;
@@ -15,9 +15,8 @@ extern crate term_grid;
extern crate unicode_width;
extern crate users;
-#[cfg(feature="git")]
-extern crate git2;
-
+#[cfg(feature="git")] extern crate git2;
+#[macro_use] extern crate lazy_static;
use std::env;
use std::path::{Component, Path};