Closed mammothbane closed 5 days ago
Does it need to be conditional? I'm not familiar with usage of or best practices involving the alloc crate, but I would suspect that if it is possible to always use alloc over std when possible then that would be preferred.
Oh yeah, I just remembered we have this:
#[cfg(not(feature = "std"))]
extern crate core as std;
Not 100% sure but I think that's a relic from a time back when you couldn't use core::
without no_std
?? These days you can use use core::
from any crate and that's what I think we ought to be doing for the things that don't require std
.
Edit: hmm yeah, I wrote that line ages ago but didn't document why. Either it was needed at the time, or I was simply too lazy to fix all of our use
s across the crate, but it seems worth doing now.
Would you be open to a PR to conditionally replace the use of
std::Vec
infrunk::Validated
withalloc::Vec
? At a quick glance, I believe this is the only required change to make the whole project work inno_std
-but-alloc
environments.