Closed abonander closed 7 years ago
@seanmonstar Are you waiting to publish a new version or did you forget again? ;P
Something tickles me weird about having the no_std
be a feature. I wanted to think about it some to see if there's something better.
It's a common convention, I made it a default so it didn't break any existing usage expecting it to work with core
right out of the box.
@seanmonstar Would you prefer to leave the #![no_std]
unconditional and just have a std
feature? I think that would work:
#![no_std]
#[cfg(feature = "std")]
extern crate std;
#[cfg(feature = "std")]
impl ::std::error::Error for Error { /* ... */ }
Ignore me, it's perfect. Thanks!
The convention is to have a feature named std
, see this comment for rationale.
Using this convention is not a breaking change, since no httparse versions that use no_std have been published yet.
@jethrogb so, have this instead:
[features]
default = ["std"]
std = []
And anyone wanting to use it in a no_std
environment sets default-features = false
.
If that seems correct, I've made a PR to do that, and I can release the new version today https://github.com/seanmonstar/httparse/pull/23
Coverage decreased (-0.3%) to 97.033% when pulling 16da533a949afb877ac74e74b0a21b07ead8d833 on abonander:master into 49bf4d81d44dbc736ad48438540bebc5f6d17e22 on seanmonstar:master.