diff --git a/src/web/commit.rs b/src/web/commit.rs index e4972ee..ef80231 100644 --- a/src/web/commit.rs +++ b/src/web/commit.rs @@ -8,13 +8,13 @@ use crate::{config::Config, somehow}; struct CommitTemplate { base: String, repo_name: String, - current: String, + current: &'static str, } pub async fn get(State(config): State<&'static Config>) -> somehow::Result { Ok(CommitTemplate { base: config.web.base(), repo_name: config.repo.name(), - current: "commit".to_string(), + current: "commit", }) } diff --git a/src/web/commit_hash.rs b/src/web/commit_hash.rs index 03b4e1c..ab1448f 100644 --- a/src/web/commit_hash.rs +++ b/src/web/commit_hash.rs @@ -30,7 +30,7 @@ impl Commit { struct CommitIdTemplate { base: String, repo_name: String, - current: String, + current: &'static str, hash: String, author: String, author_date: String, @@ -100,7 +100,7 @@ pub async fn get( Ok(CommitIdTemplate { base: config.web.base(), repo_name: config.repo.name(), - current: "commit".to_string(), + current: "commit", hash: commit.hash, author: commit.author, author_date: util::format_time(commit.author_date)?, diff --git a/src/web/index.rs b/src/web/index.rs index daf359f..a540989 100644 --- a/src/web/index.rs +++ b/src/web/index.rs @@ -17,7 +17,7 @@ struct Ref { struct IndexTemplate { base: String, repo_name: String, - current: String, + current: &'static str, tracked_refs: Vec, untracked_refs: Vec, } @@ -56,7 +56,7 @@ pub async fn get( Ok(IndexTemplate { base: config.web.base(), repo_name: config.repo.name(), - current: "index".to_string(), + current: "index", tracked_refs, untracked_refs, })