Lint cleanup when prometheus not enabled.

This commit is contained in:
Bill Thiede 2019-10-12 20:42:41 -07:00
parent 051482e7fe
commit 5d5f3c7244

View File

@ -8,13 +8,13 @@ extern crate rtiow;
extern crate stderrlog;
extern crate structopt;
#[macro_use]
#[cfg(feature = "prom")]
extern crate lazy_static;
#[macro_use]
#[cfg(feature = "prom")]
extern crate prometheus;
use std::fs;
use std::time::Instant;
use chrono::DateTime;
use chrono::Utc;
@ -46,7 +46,7 @@ fn push_metrics(_push_gateway_addr: &str, _instance: String, start_time: &DateTi
#[cfg(feature = "prom")]
fn push_metrics(push_gateway_addr: &str, instance: String, start_time: &DateTime<Utc>) {
let runtime = start_instant.elapsed();
let runtime = (Utc::now() - *start_time).to_std().unwrap();
info!(
"Render time {}.{} seconds",
runtime.as_secs(),
@ -117,7 +117,6 @@ fn main() -> Result<(), std::io::Error> {
.init()
.unwrap();
let start_time: DateTime<Utc> = Utc::now();
let start_instant = Instant::now();
let opt = Opt::from_args();
let scene = opt.model.scene(&opt);
fs::create_dir_all(&opt.output)?;