Commit 66388d9
authored
Rollup merge of rust-lang#141211 - fluiderson:dev, r=thomcc
Replace `try_reserve_exact` with `try_with_capacity` in `std::fs::read`
This change restores the previous behavior prior to rust-lang#117925. That PR was made to handle OOM errors that turn into a panic with `Vec::with_capacity`. `try_reserve_exact` was used for that since there was no `try_with_capacity` method at the time. It was added later in rust-lang#120504. I think it'd a better fit here.1 file changed
+1
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
289 | | - | |
| 288 | + | |
290 | 289 | | |
291 | 290 | | |
292 | 291 | | |
| |||
0 commit comments