fitzgen / bumpalo

A fast bump allocation arena for Rust
https://docs.rs/bumpalo
Apache License 2.0
1.41k stars 111 forks source link

Implement `std::io::Write` for `Vec<'bump, u8>` #216

Closed marmeladema closed 1 year ago

marmeladema commented 1 year ago

Hi @fitzgen

Here is my attempt to implement std::io::Write for Vec<'bump, u8> I believe there are other common traits like this we could implement for some collections but I have left that for another time (but I 'd be happy to contribute those).

I have a few questions:

  1. The current std feature does not do anything on its own, it's currently only useful if you also have the collections feature enabled too. I think it's fine but I wondered if having instead a collections-std feature depending on collections would be better? Although the std feature is pretty standard across the community.
  2. Are there enough tests and are they at the right place? The implementation seems trivial and has been copied from std (except for the vectored part that is currently unstable).

Fixes https://github.com/fitzgen/bumpalo/issues/215

fitzgen commented 1 year ago

@marmeladema do you need a release with this?

marmeladema commented 1 year ago

If that's not too much to ask, that would be helpful yeah.

fitzgen commented 1 year ago

Just published 3.14.0!

marmeladema commented 1 year ago

Thanks a lot! That's really helpful :-)