chiark / gitweb /
packetframe: Use concrete types in two places
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 17 May 2021 13:08:13 +0000 (14:08 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 17 May 2021 13:58:58 +0000 (14:58 +0100)
This will let us inherit Send and Sync from the inner writer.

Acked-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/packetframe.rs

index 745568bf305ed7cc5d56d0a52ad417c070496d14..919df430d4dba4ce42abfc9645aa6067ff15552a 100644 (file)
@@ -390,8 +390,7 @@ impl<W:Write> FrameWriter<W> {
   }
 
   #[throws(MgmtChannelWriteError)]
-  pub fn write_withbulk<'c>(&'c mut self) -> ResponseWriter<impl Write + 'c>
-  {
+  pub fn write_withbulk<'c>(&'c mut self) -> ResponseWriter<'c,W> {
     ResponseWriter { f: self.new_frame()? }
   }
 
@@ -448,7 +447,7 @@ pub struct ResponseWriter<'c,W:Write> { f: WriteFrame<'c,W> }
 
 impl<'c,W:Write> ResponseWriter<'c,W> {
   #[throws(MgmtChannelWriteError)]
-  pub fn respond<'t,T>(mut self, val: &'t T) -> WriteFrame<'c, impl Write + 'c>
+  pub fn respond<'t,T>(mut self, val: &'t T) -> WriteFrame<'c,W>
   where T: Serialize + Debug
   {
     rmp_serde::encode::write_named(&mut self.f, val)?;