-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a serde1-alloc
feature flag
#111
Conversation
5b4d5f2
to
c8f5201
Compare
serde1-alloc
feature flag
c8f5201
to
aa6c0b7
Compare
Hmmm yeah, good catch. I think this is the right path. To respond to your alternatives:
I'm just about to release 1.0, so this is the time to make backwards incompatible changes. However, I think making
Yeah I think Rust 1.60 is just too new. This is a little unfortunate because I suspect moving to this will be a breaking change and I do not expect to release a |
Since none of the |
That is an option, but one that seems higher risk with respect to backcompat. e.g., If bstr ever does care about serde's std support. |
Then perhaps exposing three features like in this PR might be the best option? Though if you don't care about breaking changes right now, then they could be renamed to |
Right, that's what I plan to do: #40 (comment) But Sorry if I wasn't clear about that. I was mostly just trying to write out a justification for why the alternatives were considered, but ultimately that 3 different features seems like the right way to go. |
Now that bstr has an 'alloc' feature, we need to rethink how we setup the serde feature flags. Previously, all we had was 'std' and 'no std'. But now we have 'std', 'alloc only' and 'core only'. In particular, 'no std' is split into 'alloc only' and 'core only', since neither one bring in std. To reflect this trichotomy, we rename 'serde1' to 'serde1-std', and split 'serde1-nostd' into 'serde1-alloc' and 'serde1-core'. Closes #111
Since you are renaming anyways, why not get rid of the |
In case |
Now that bstr has an 'alloc' feature, we need to rethink how we setup the serde feature flags. Previously, all we had was 'std' and 'no std'. But now we have 'std', 'alloc only' and 'core only'. In particular, 'no std' is split into 'alloc only' and 'core only', since neither one bring in std. To reflect this trichotomy, we rename 'serde1' to 'serde1-std', and split 'serde1-nostd' into 'serde1-alloc' and 'serde1-core'. Closes #111
Currently the
bstring_serde
module is hidden behind theserde1
feature flag, however this flag also pulls in thestd
flag, which is unnecessary.This PR adds an additional feature flag to enable that impl without depending on the entire
std
flag.Alternatives considered
serde1
feature flag to only depend on["alloc", "serde1-nostd", "serde/alloc"]
. I do not know if you consider this backwards incompatible (or if you care).