diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/renderer.rs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/renderer.rs b/src/renderer.rs index 404dd5d..f36636b 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -4,7 +4,7 @@ use chrono_humanize::Humanize; use maud::{html, Markup, PreEscaped, DOCTYPE}; use std::time::SystemTime; use strum::IntoEnumIterator; - +use structopt::clap::{crate_name, crate_version}; use crate::archive::CompressionMethod; use crate::listing::{Breadcrumb, Entry, SortingMethod, SortingOrder}; @@ -148,22 +148,11 @@ pub fn page( } } -// Get version info -fn get_version_info() -> String { - const PROG_NAME: Option<&'static str> = option_env!("CARGO_PKG_NAME"); - const VERSION: Option<&'static str> = option_env!("CARGO_PKG_VERSION"); - format!( - "{}/{}", - PROG_NAME.unwrap_or("miniserve"), - VERSION.unwrap_or("unknown") - ) -} - // Partial: version footer fn version_footer() -> Markup { html! { p style="text-align:center;padding-top:1em" { - (get_version_info()) + (format!("{}/{}", crate_name!(), crate_version!())) } } } |