From 9764e722b27e33d55fddaca5b0baa190d8992cdc Mon Sep 17 00:00:00 2001 From: spezifisch Date: Sat, 27 Jul 2024 00:50:34 +0200 Subject: [PATCH] another buggy release --- src/main.rs | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/main.rs b/src/main.rs index cf065b9..c4ede0e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,23 +28,21 @@ struct Opts { count: Option, } -fn long_version() -> &'static str { - const LONG_VERSION: &str = { - let commit_hash = option_env!("VERGEN_GIT_SHA").unwrap_or("unknown"); - let build_timestamp = option_env!("VERGEN_BUILD_TIMESTAMP").unwrap_or("unknown"); - let rust_version = option_env!("VERGEN_RUSTC_SEMVER").unwrap_or("unknown"); - - concat!( - "ifstat-rs: A tool to report network interface statistics.\n\n", - "Built with Rust.\n\n", - "Build info:\n", - "Commit: ", commit_hash, "\n", - "Build Timestamp: ", build_timestamp, "\n", - "Rust Version: ", rust_version, "\n", - "Repo: https://github.com/spezifisch/ifstat-rs" - ) - }; - LONG_VERSION +fn long_version() -> String { + let commit_hash = option_env!("VERGEN_GIT_SHA").unwrap_or("unknown"); + let build_timestamp = option_env!("VERGEN_BUILD_TIMESTAMP").unwrap_or("unknown"); + let rust_version = option_env!("VERGEN_RUSTC_SEMVER").unwrap_or("unknown"); + + format!( + "ifstat-rs: A tool to report network interface statistics.\n\n\ + Built with Rust.\n\n\ + Build info:\n\ + Commit: {}\n\ + Build Timestamp: {}\n\ + Rust Version: {}\n\ + Repo: https://github.com/spezifisch/ifstat-rs", + commit_hash, build_timestamp, rust_version + ) } #[tokio::main]