Skip to content

Commit

Permalink
allow setting any "Display" value in owning template
Browse files Browse the repository at this point in the history
Not having to do .to_string() is convenient in heavy template uses.
  • Loading branch information
Canop committed Jan 27, 2021
1 parent fb126c5 commit 94e1c14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "minimad"
version = "0.6.7"
version = "0.6.8"
authors = ["dystroy <denys.seguret@gmail.com>"]
repository = "https://github.com/Canop/minimad"
description = "light Markdown parser"
Expand Down
8 changes: 4 additions & 4 deletions src/owning_template_expander.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ impl<'s> OwningTemplateExpander<'s> {

/// replace placeholders with name `name` with the given value, non interpreted
/// (i.e. stars, backquotes, etc. don't mess the styling defined by the template)
pub fn set<S: Into<String>>(&mut self, name: &'s str, value: S) -> &mut Self {
pub fn set<S: std::fmt::Display>(&mut self, name: &'s str, value: S) -> &mut Self {
self.ops.push(FillingOperation::Set {
name,
value: value.into(),
value: value.to_string(),
});
self
}
Expand Down Expand Up @@ -155,10 +155,10 @@ impl<'s> OwningSubTemplateExpander<'s> {
}
/// replace placeholders with name `name` with the given value, non interpreted
/// (i.e. stars, backquotes, etc. don't mess the styling defined by the template)
pub fn set<S: Into<String>>(&mut self, name: &'s str, value: S) -> &mut Self {
pub fn set<S: std::fmt::Display>(&mut self, name: &'s str, value: S) -> &mut Self {
self.ops.push(SubFillingOperation::Set {
name,
value: value.into(),
value: value.to_string(),
});
self
}
Expand Down

0 comments on commit 94e1c14

Please sign in to comment.