-
Notifications
You must be signed in to change notification settings - Fork 44
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
add no-std
#25
add no-std
#25
Conversation
it looks like some of the changes in here were done in #29; please rebase |
876073a
to
ab797ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is amazing! nice work :)
I left some questions/comments on an initial pass
At a high-level, I think this direction makes sense -- the only thing I'd suggest is to take inspiration from the serde
library which also supports std vs no-std in this way but they have a central lib
that does the import logic once and then can simply use lib::*;
everywhere else
see here: https://github.com/serde-rs/serde/blob/master/serde/src/lib.rs#L151
and here for usage: https://github.com/serde-rs/serde/blob/master/serde/src/ser/mod.rs#L110
I'll want to make another pass to look more deeply into the thiserror
issue and also investigate some of the dependency changes but I like the direction this is going in and think no-std
is a great addition to this library
@ralexstokes thanks for the review! I have made the requested individual changes as well as the std lib imports as modelled by the serde crate in f29b3fe. Let me know if this is what you've had in mind. I can also move the crate std mod into lib, if you prefer (but I guess then the import would just be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice updates!
things are looking good, I left a few questions
I like how can you update the mod name and then the imports so that it is |
also the fact that the tests are passing even though we are 'ignoring' some errors suggests the code coverage is not ideal -- I'll leave a note here to investigate further |
74356af
to
52cb613
Compare
Done in d776326. I removed the |
This is a little worrying. The dropped error check I introduced was in pack_bytes, used by I had a quick look but must admit I couldn't quickly see how to add test cases that would trigger those error conditions. |
Is this still being worked on? Is there any way i can contribute to this? |
@dharjeezy it's ready for review! @ralexstokes will probably get to it as soon as he can. 😄 You are welcome to also review and test if you are keen. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few comments to resolve, but I think we are only a round or two of back/forth before we can merge :)
3bf70f4
to
4c3b9e5
Compare
@ralexstokes thanks for the review! 😄 Comments actioned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed the Cargo manifest and I think we can tighten it up some
I'd like to get to a point where the default thing is the status quo and only if you do --no-default-features
will you get a no_std
compatible library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another round of questions/comments :)
c717398
to
1392dbc
Compare
5c82d47
to
3bd2990
Compare
no-std
support by addingstd
module that imports fromstd
orcore
/alloc
depending if std feature is toggled.thiserror
crate, no support for no-std yet, but in the works. It depends onError
being included in the core crate: MoveError
trait into core rust-lang/project-error-handling#3 andthiserror
issue: add #![no_std] support dtolnay/thiserror#196