Commit 1361b02
authored
Rollup merge of rust-lang#74088 - tmiasko:write-all-vectored-empty, r=KodrAus
Avoid writes without any data in `Write::write_all_vectored`
Previously, when non-empty sequence of empty IoSlices have been provided
to `Write::write_all_vectored`, the buffers would be written as is with
`Write::write_vectored` and subsequently the return value `Ok(0)` would
be misinterpreted as an error.
Avoid writes without any data by advancing the buffers first. This
matches the documented behaviour of `Write::write_all_vectored`
and is analogous to what happens in `Write::write_all`.1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
255 | 254 | | |
256 | 255 | | |
257 | 256 | | |
| |||
1435 | 1434 | | |
1436 | 1435 | | |
1437 | 1436 | | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
1438 | 1440 | | |
1439 | 1441 | | |
1440 | 1442 | | |
1441 | 1443 | | |
1442 | 1444 | | |
1443 | | - | |
| 1445 | + | |
1444 | 1446 | | |
1445 | 1447 | | |
1446 | 1448 | | |
| |||
2958 | 2960 | | |
2959 | 2961 | | |
2960 | 2962 | | |
| 2963 | + | |
2961 | 2964 | | |
2962 | 2965 | | |
2963 | 2966 | | |
| |||
0 commit comments