summaryrefslogtreecommitdiffstats
path: root/src/printer.rs
diff options
context:
space:
mode:
authorPeter Hebden <peterhebden6@gmail.com>2023-07-09 01:33:48 +0100
committerDavid Peter <david.peter@bosch.com>2023-09-01 20:52:55 +0200
commit906e77437248da09e904431de31ff5b677db6a43 (patch)
treecfb2ca717b7d1657b4bcdcf13de44f0515fea210 /src/printer.rs
parentd929becefcdc528706ab0d6d4407e64999c6ad45 (diff)
Handle todos
Diffstat (limited to 'src/printer.rs')
-rw-r--r--src/printer.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/printer.rs b/src/printer.rs
index deeebe49..a317bdcc 100644
--- a/src/printer.rs
+++ b/src/printer.rs
@@ -134,7 +134,16 @@ impl<'a> Printer for SimplePrinter<'a> {
} else {
match handle {
OutputHandle::IoWrite(handle) => handle.write_all(line_buffer)?,
- OutputHandle::FmtWrite(handle) => todo!(),
+ OutputHandle::FmtWrite(handle) => {
+ write!(
+ handle,
+ "{}",
+ std::str::from_utf8(line_buffer).map_err(|_| Error::Msg(
+ "encountered invalid utf8 while printing to non-io buffer"
+ .to_string()
+ ))?
+ )?;
+ }
}
};
}