Add `BytesMut::try_reserve()`
I rebased #521.
While I do not claim this implements #484, I think the review was too harsh: BytesMut is the only
API with a reserve method, adding other fallible allocations APIs should not be done in this MR.
Hello, I also need this. Any way we can get this merged?
Actually, it seems like Vec::try_reserve is not available on our minimum supported rust version.
Vec::try_reserve has been in Rust since 1.57, which was released in December 2, 2021 (almost three years ago). Is there any plan on raising the MSRV anytime soon? Otherwise would you accept a PR gating this API behind a feature gate?
Given that even syn is at 1.61, I think a bump to 1.57 is fine.
Any chance the MSRV can finally get a bump so this PR could get merged?
I'll add that even Yocto Kirkstone is on a version newer than the proposed MSRV (they're at 1.59), so I don't really see anyone still stuck on < 1.57. There's still Debian Bullseye, but after 4 years since the release and 1 year of LTS still left, it's basically dead.
I've opened a PR for the MSRV bump #788
https://github.com/tokio-rs/bytes/pull/788 has been merged so this now should be ready to be rebased
I've opened #789 as an alternative to this.