(no title)
burntsushi | 2 months ago
`Vec::spare_capacity_mut`[1] gives you a view into the unused capacity. There's nothing "invalid" about it.
[1]: https://doc.rust-lang.org/std/vec/struct.Vec.html#method.spa...
burntsushi | 2 months ago
`Vec::spare_capacity_mut`[1] gives you a view into the unused capacity. There's nothing "invalid" about it.
[1]: https://doc.rust-lang.org/std/vec/struct.Vec.html#method.spa...
formerly_proven|2 months ago
burntsushi|2 months ago
It seems like your complaint is more about "more APIs should accept possibly uninitialized data, but they don't." Which is fair, but I don't know how big of a deal it really is. There is for sure desire to make this work with `std::io::Read`, and indeed, there are unstable APIs for that[1].
[1]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read...