Commit 2c06191
committed
Replace unsafe unwrap() in DeflateEncoder::finish with io::Result error
The `DeflateEncoder::finish` method used `.unwrap()` on an `Option` returned by `self.writer.take()`. This change replaces it with `.ok_or_else()`, returning a descriptive `std::io::Error` instead. This prevents potential panics and improves the overall robustness of the streaming API.1 parent 97a5bfd commit 2c06191
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
203 | 205 | | |
204 | 206 | | |
205 | 207 | | |
| |||
0 commit comments