mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-31 00:12:06 +00:00
templater: make Literal(str) or str usable as a template
This commit is contained in:
parent
7b206e6fb5
commit
0b27f8371a
1 changed files with 6 additions and 0 deletions
|
@ -55,6 +55,12 @@ impl Template<()> for String {
|
|||
}
|
||||
}
|
||||
|
||||
impl Template<()> for &str {
|
||||
fn format(&self, _: &(), formatter: &mut dyn Formatter) -> io::Result<()> {
|
||||
formatter.write_str(self)
|
||||
}
|
||||
}
|
||||
|
||||
impl Template<()> for Timestamp {
|
||||
fn format(&self, _: &(), formatter: &mut dyn Formatter) -> io::Result<()> {
|
||||
formatter.write_str(&time_util::format_absolute_timestamp(self))
|
||||
|
|
Loading…
Reference in a new issue