From 1a6e71170e5136636f5b3fe6d79738bc4ded5162 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Sun, 22 Jan 2023 21:50:39 +0900 Subject: [PATCH] templater: remove string.short() method I think this is a remainder of 68ad712e123e "Templater: Combine Change and Commit id templates." It doesn't make sense that description.short() prints the first 12 characters. --- src/template_parser.rs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/template_parser.rs b/src/template_parser.rs index 6a6b2ab1d..85d06abc8 100644 --- a/src/template_parser.rs +++ b/src/template_parser.rs @@ -56,14 +56,6 @@ fn parse_string_literal(pair: Pair) -> String { result } -struct StringShort; - -impl TemplateProperty for StringShort { - fn extract(&self, context: &String) -> String { - context.chars().take(12).collect() - } -} - struct StringFirstLine; impl TemplateProperty for StringFirstLine { @@ -188,7 +180,6 @@ fn parse_string_method<'a>(method: Pair) -> PropertyAndLabels<'a, String> // TODO: validate arguments let this_function = match name.as_str() { - "short" => Property::String(Box::new(StringShort)), "first_line" => Property::String(Box::new(StringFirstLine)), name => panic!("no such string method: {name}"), };