aboutsummaryrefslogtreecommitdiffstats
path: root/askama_shared
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--askama_shared/src/filters/mod.rs4
-rw-r--r--askama_shared/src/generator.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/askama_shared/src/filters/mod.rs b/askama_shared/src/filters/mod.rs
index 7009f58..66a0ee2 100644
--- a/askama_shared/src/filters/mod.rs
+++ b/askama_shared/src/filters/mod.rs
@@ -193,7 +193,7 @@ pub fn format() {}
/// followed by a blank line becomes a paragraph break `<p>`.
pub fn linebreaks<T: fmt::Display>(s: T) -> Result<String> {
let s = s.to_string();
- let linebroken = s.replace("\n\n", "</p><p>").replace("\n", "<br/>");
+ let linebroken = s.replace("\n\n", "</p><p>").replace('\n', "<br/>");
Ok(format!("<p>{}</p>", linebroken))
}
@@ -201,7 +201,7 @@ pub fn linebreaks<T: fmt::Display>(s: T) -> Result<String> {
/// Converts all newlines in a piece of plain text to HTML line breaks
pub fn linebreaksbr<T: fmt::Display>(s: T) -> Result<String> {
let s = s.to_string();
- Ok(s.replace("\n", "<br/>"))
+ Ok(s.replace('\n', "<br/>"))
}
/// Replaces only paragraph breaks in plain text with appropriate HTML
diff --git a/askama_shared/src/generator.rs b/askama_shared/src/generator.rs
index 738b878..d264897 100644
--- a/askama_shared/src/generator.rs
+++ b/askama_shared/src/generator.rs
@@ -981,7 +981,7 @@ impl<'a, S: std::hash::BuildHasher> Generator<'a, S> {
for s in mem::take(&mut self.buf_writable) {
match s {
Writable::Lit(s) => {
- buf_format.write(&s.replace("{", "{{").replace("}", "}}"));
+ buf_format.write(&s.replace('{', "{{").replace('}', "}}"));
size_hint += s.len();
}
Writable::Expr(s) => {