Finish writing and flush the compression stream
(self)
| 113 | |
| 114 | /// Finish writing and flush the compression stream |
| 115 | pub fn finish(self) -> anyhow::Result<()> { |
| 116 | let encoder = self.serializer.into_inner(); |
| 117 | let mut writer = encoder.finish()?; |
| 118 | |
| 119 | // Flush the writer to ensure all data is written to the underlying writer |
| 120 | writer.flush()?; |
| 121 | |
| 122 | Ok(()) |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | #[cfg(test)] |
no test coverage detected