remove no-std-compat#43
Conversation
|
Thanks for the PR. Regarding the strange error: that should be gone after rebasing on However, I'm not sure about this change. What exactly is the practical benefit? The |
Making the dependency tree smaller. Having less (redundant) dependencies is always better, because less code has to be compiled, documented and downloaded (even if it is just a few kilobytes). I think this is a very debatable topic and really reminds me of the discussions revolving around the I do not mind crates having dependencies, but for example if a crate depends on use thiserror::Error;
#[derive(Error, Debug, Clone)]
pub enum DataStoreError {
#[error("data store disconnected")]
Disconnect(#[from] io::Error),
#[error("the data for key `{0}` is not available")]
Redaction(String),
#[error("invalid header (expected {expected:?}, found {found:?})")]
InvalidHeader {
expected: String,
found: String,
},
#[error("unknown data store error")]
Unknown,
}I would make a PR to remove I feel similarly about
I would actually prefer to use Cargo features are designed to be opt-in, which is why you should do something like this: [features]
default-features = ["std"]
std = []instead of [features]
default-features = []
no-std = []Using It also makes the code more readable as you can clearly see which imports make allocations and which do not.
Yes, but is it really necessary to compile this? It feels like an unnecessary dependency (especially for a crate with so few imports). |
|
Quite a delay, but I now agree with you :D thanks for the PR |
|
I did not expect this to be merged or be without merge conflicts after such a long time...but anyway, thank you for merging. |
This PR removes the dependency on the
no-std-compatcrate to make this crate have zero dependencies.There is little benefit in using the crate, because as can be seen in the diff of the PR, there are only a few lines that have to be changed to make it work without it.
On my local machine the tests failed on nightly with confusing errors like this one:
idk why they fail, but they work on stable.