Lokathor / tinyvec

Just, really the littlest Vec you could need. So smol.
https://docs.rs/tinyvec
Apache License 2.0
648 stars 49 forks source link

impl std::io::Write for TinyVec<[u8; x]> #151

Open eeeebbbbrrrr opened 3 years ago

eeeebbbbrrrr commented 3 years ago

Would y'all accept a PR that implements std::io::Write for u8-based TinyVecs?

If so, I'd be thrilled to submit it.

Lokathor commented 3 years ago

Yes. I'd love it. It should be behind a feature named std but otherwise I think you can figure out the rest.

eeeebbbbrrrr commented 3 years ago

Consider it done. Thanks!

eeeebbbbrrrr commented 3 years ago

I have a question regarding a std feature...

How do I use that to defeat the #![no_std] at the top of src/lib.rs? This is probably my lack of Rust knowledge showing...

Lokathor commented 3 years ago

you'd change that to #![cfg_attr(not(feature = "std"), no_std)]

eeeebbbbrrrr commented 3 years ago

Thank you. I'd have never figured that out.

I'll put up a PR tomorrow. It was overly simple to implement. Y'all did a great job with TinyVec. Every time I find a use for it in my projects performance improves measurably. It's such a valuable crate.