summaryrefslogtreecommitdiff
path: root/src/works/mod.rs
diff options
context:
space:
mode:
authorWriterV2 <primary-v2@protonmail.com>2023-06-03 14:33:09 +0200
committerWriterV2 <primary-v2@protonmail.com>2023-06-03 14:33:09 +0200
commit30b707d610f4daf025da01b12247bd3b7ebd9e55 (patch)
tree2c82ac3ba39af5fde041f074e51b4fb9f56c092f /src/works/mod.rs
parent683ca3627f38461cbbdee321a15821b46e72ae6a (diff)
Clean command pattern for works
Diffstat (limited to 'src/works/mod.rs')
-rw-r--r--src/works/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/works/mod.rs b/src/works/mod.rs
index 77dd35d..0970cb1 100644
--- a/src/works/mod.rs
+++ b/src/works/mod.rs
@@ -22,15 +22,15 @@ pub trait Works: for<'a> Deserialize<'a> + Serialize {
}
// render page for every work
- fn render_single_pages(&self, tera_instance: &tera::Tera, template_name: &str) -> Result<()>;
+ fn render_single_pages(self, tera_instance: &tera::Tera, template_name: &str) -> Result<Self>;
// render corresponding overview HTML template
// with its tera context
fn render_overview_page(
- &self,
+ self,
tera_instance: &tera::Tera,
filename_without_extension: &str,
- ) -> Result<()> {
+ ) -> Result<Self> {
std::fs::write(
format!("docs/{}.html", filename_without_extension).as_str(),
tera_instance
@@ -51,6 +51,6 @@ pub trait Works: for<'a> Deserialize<'a> + Serialize {
filename_without_extension
)
})?;
- Ok(())
+ Ok(self)
}
}