tinyvec icon indicating copy to clipboard operation
tinyvec copied to clipboard

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

Open eeeebbbbrrrr opened this issue 4 years ago • 5 comments

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

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

eeeebbbbrrrr avatar Sep 22 '21 23:09 eeeebbbbrrrr

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

Lokathor avatar Sep 23 '21 00:09 Lokathor

Consider it done. Thanks!

eeeebbbbrrrr avatar Sep 23 '21 00:09 eeeebbbbrrrr

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...

eeeebbbbrrrr avatar Sep 23 '21 23:09 eeeebbbbrrrr

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

Lokathor avatar Sep 23 '21 23:09 Lokathor

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.

eeeebbbbrrrr avatar Sep 23 '21 23:09 eeeebbbbrrrr