aboutsummaryrefslogtreecommitdiffstats
path: root/src/writer.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-10-27 06:35:23 -0400
committerJesse Luehrs <doy@tozt.net>2019-10-27 06:35:23 -0400
commit4d7d1006b0daec59ea94b4ebfa7a5ebf1c316f31 (patch)
treeee51e7aa0fb6aa7598c5c739473a398ba3e512ca /src/writer.rs
parenta5e7c90d0af6a0b6080f17df2910f69ef114b210 (diff)
downloadttyrec-4d7d1006b0daec59ea94b4ebfa7a5ebf1c316f31.tar.gz
ttyrec-4d7d1006b0daec59ea94b4ebfa7a5ebf1c316f31.zip
creator should just return the frame
can convert the frame to bytes separately
Diffstat (limited to 'src/writer.rs')
-rw-r--r--src/writer.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/writer.rs b/src/writer.rs
index 1717032..680da3d 100644
--- a/src/writer.rs
+++ b/src/writer.rs
@@ -20,7 +20,8 @@ impl<W: tokio::io::AsyncWrite> Writer<W> {
time: std::time::Instant,
data: &[u8],
) -> crate::error::Result<()> {
- let bytes = self.creator.frame(time, data)?;
+ let frame = self.creator.frame(time, data);
+ let bytes: Vec<u8> = std::convert::TryFrom::try_from(frame)?;
self.to_write.extend(bytes.iter());
Ok(())
}