src/backend/render.rs: updates to use BufWriter instead of Write trait

This commit is contained in:
2026-05-07 00:44:39 +00:00
parent b11134c754
commit 079cfc7a64
2 changed files with 6 additions and 6 deletions

View File

@@ -21,7 +21,7 @@
use std::{
error::Error,
fmt::{ self, Display, Formatter },
io::Write,
io::{ BufWriter, Write },
path::PathBuf,
};
@@ -131,8 +131,8 @@ impl Page {
}
/// Render a page to a Write-able stream
pub fn render(
&self, mut dest: Box<dyn Write>
pub fn render<W: Write>(
&self, dest: &mut BufWriter<W>
) -> Result<(), Box<dyn Error>> {
/* TODO: replace ./assets/ with the actual templates directory,
* i.e. /usr/local/share/mintee/ */

View File

@@ -21,7 +21,7 @@
use std::{
env::current_dir,
error::Error,
io::stdout,
io::{ BufWriter, stdout }
};
use mintee::backend::render::{ Page, PageKind, Repo };
@@ -40,7 +40,7 @@ fn main() -> Result<(), Box<dyn Error>> {
entity,
name,
None,
Some("src".to_string()),
None,
);
let page = Page::new(
@@ -48,5 +48,5 @@ fn main() -> Result<(), Box<dyn Error>> {
None,
);
page.render(Box::new(stdout()))
page.render(&mut BufWriter::new(stdout()))
}