From 628f3501a20a54b54a348198228d5fd054c886bd Mon Sep 17 00:00:00 2001 From: Magnus Hoff Date: Tue, 24 Oct 2017 12:59:37 +0200 Subject: [PATCH] Remove pointless self-link --- src/resources/changes_resource.rs | 19 ++----------------- templates/changes.html | 2 +- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/resources/changes_resource.rs b/src/resources/changes_resource.rs index 847276c..305ff25 100644 --- a/src/resources/changes_resource.rs +++ b/src/resources/changes_resource.rs @@ -249,23 +249,8 @@ impl Resource for ChangesResource { } } - fn author_clause(&self) -> String { - #[derive(BartDisplay)] - #[template_string=" by {{author}}"] - struct AuthorClause<'a> { - link: &'a str, - author: &'a str, - } - - match self.resource.author { - Some(ref x) => AuthorClause { - link: &self.resource.query_args() - .author(Some(x.clone())) - .into_link(), - author: &x - }.to_string(), - None => "".to_owned(), - } + fn author(&self) -> Option { + self.resource.author.clone() } fn all_articles_link(&self) -> Option { diff --git a/templates/changes.html b/templates/changes.html index 80b1117..43515fb 100644 --- a/templates/changes.html +++ b/templates/changes.html @@ -6,7 +6,7 @@

These are the {{^newer}}most recent{{/newer}} changes that have been - made to{{{subject_clause()}}}{{{author_clause()}}}. + made to{{{subject_clause()}}}{{#author()}} by {{.}}{{/author()}}.