Closed marmeladema closed 9 months ago
First of all, thank you for bumpalo, it's really awesome :)
I encountered a roadblock for a specific usecase recently when I wanted to use serde_json::to_writer on a Vec<'bump, u8> when I realized std::io::Write is not actually implemented whereas it is for Vec<u8> in the standard library: https://doc.rust-lang.org/std/io/trait.Write.html#impl-Write-for-Vec%3Cu8,+A%3E
serde_json::to_writer
Vec<'bump, u8>
std::io::Write
Vec<u8>
There does not seem to be any technical limitation in bumpalo that would prevent from implementing it except:
Bumpalo is a no_std crate. It depends only on the alloc and core crates.
since std::io::Write is not available in core.
core
@fitzgen would you be inclined to accept a contribution that implement std::io::Write? Probably gated by a new std feature disabled by default?
std
Thank you for taking the time to read my request.
Yes, introducing a std feature that is disabled by default makes sense. Make sure to document the feature in the readme as well. Thanks!
First of all, thank you for bumpalo, it's really awesome :)
I encountered a roadblock for a specific usecase recently when I wanted to use
serde_json::to_writer
on aVec<'bump, u8>
when I realizedstd::io::Write
is not actually implemented whereas it is forVec<u8>
in the standard library: https://doc.rust-lang.org/std/io/trait.Write.html#impl-Write-for-Vec%3Cu8,+A%3EThere does not seem to be any technical limitation in bumpalo that would prevent from implementing it except:
since
std::io::Write
is not available incore
.@fitzgen would you be inclined to accept a contribution that implement
std::io::Write
? Probably gated by a newstd
feature disabled by default?Thank you for taking the time to read my request.