Update formatting

This commit is contained in:
Dirkjan Ochtman 2019-07-24 23:01:04 +02:00
parent 5b9c3ca4ac
commit 0efd48e037
2 changed files with 9 additions and 6 deletions

View File

@ -77,10 +77,7 @@ pub fn escape<E>(string: &str, escaper: E) -> Escaped<'_, E>
where
E: Escaper,
{
Escaped {
string,
escaper,
}
Escaped { string, escaper }
}
pub struct Escaped<'a, E>

View File

@ -55,7 +55,10 @@ impl<'a> Config<'a> {
for raw_s in raw_syntaxes {
let name = raw_s.name;
if syntaxes.insert(name.to_string(), Syntax::from(raw_s)).is_some() {
if syntaxes
.insert(name.to_string(), Syntax::from(raw_s))
.is_some()
{
panic!("syntax \"{}\" is already defined", name)
}
}
@ -404,7 +407,10 @@ mod tests {
vec![
(str_set(&["js"]), "::askama::Js".into()),
(str_set(&["html", "htm", "xml"]), "::askama::Html".into()),
(str_set(&["md", "none", "txt", "yml", ""]), "::askama::Text".into()),
(
str_set(&["md", "none", "txt", "yml", ""]),
"::askama::Text".into()
),
(str_set(&["j2", "jinja", "jinja2"]), "::askama::Html".into()),
]
);