templater: remove string.short() method

I think this is a remainder of 68ad712e12 "Templater: Combine Change and
Commit id templates." It doesn't make sense that description.short() prints
the first 12 characters.
This commit is contained in:
Yuya Nishihara 2023-01-22 21:50:39 +09:00
parent b53f004372
commit 1a6e71170e

View file

@ -56,14 +56,6 @@ fn parse_string_literal(pair: Pair<Rule>) -> String {
result
}
struct StringShort;
impl TemplateProperty<String, String> for StringShort {
fn extract(&self, context: &String) -> String {
context.chars().take(12).collect()
}
}
struct StringFirstLine;
impl TemplateProperty<String, String> for StringFirstLine {
@ -188,7 +180,6 @@ fn parse_string_method<'a>(method: Pair<Rule>) -> 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}"),
};