aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuben Beltran del Rio <jj@r.bdr.sh>2025-11-30 16:53:30 +0100
committerRuben Beltran del Rio <jj@r.bdr.sh>2025-11-30 16:54:17 +0100
commitd8a1c8d7eefd2c5aa940179f8ef083173a7f9f4e (patch)
tree28b4db712da7a247ccda396cd4ada7feb6e2ea76 /src
parentb70bc1d6433fc0001336c968465fbe653921491c (diff)
Format with updated rust tooling
Diffstat (limited to 'src')
-rw-r--r--src/post.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/post.rs b/src/post.rs
index 2e2b0e6..6c49b21 100644
--- a/src/post.rs
+++ b/src/post.rs
@@ -30,10 +30,7 @@ impl Post {
pub fn to_template_value(&self) -> Context {
let mut context = HashMap::new();
- context.insert(
- "id".to_string(),
- Value::String(self.metadata.id.to_string()),
- );
+ context.insert("id".to_string(), Value::String(self.metadata.id.clone()));
context.insert(
"created_on".to_string(),
Value::Unsigned(self.metadata.created_on),
@@ -45,12 +42,12 @@ impl Post {
context.insert("title".to_string(), Value::String(self.title()));
context.insert("index".to_string(), Value::Unsigned(self.index.into()));
- context.insert("html".to_string(), Value::String(self.html.to_string()));
+ context.insert("html".to_string(), Value::String(self.html.clone()));
context.insert(
"escaped_html".to_string(),
- Value::String(self.escaped_html().to_string()),
+ Value::String(self.escaped_html().clone()),
);
- context.insert("raw".to_string(), Value::String(self.raw.to_string()));
+ context.insert("raw".to_string(), Value::String(self.raw.clone()));
context
}