-
Notifications
You must be signed in to change notification settings - Fork 7
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
Avoid using std
dependency
#5
Comments
I myself don't do embedded programming but I guess there shouldn't a problem with switching from |
I currently use a vector for the debug output https://github.com/MaikKlein/enumflags/blob/master/enumflags_derive/src/lib.rs#L229 I also want to generalize that behavior so that you can create a flag from a vector of flags, and that you can create a vector of flags from a single flag. I do this to generate a better debug output, eg I think that it should be possible to feature gate the std usage. |
I took care of removing std-dependent code in my fork, but I need your help with some things:
I think these changes are enough. I'll make a (new) PR if I make it work... |
Which means I need a way to convert from a list of flags into a I think we should just feature gate the std usage like here https://github.com/BurntSushi/byteorder/blob/master/src/lib.rs#L53
I really need to add some documentation and tests. |
Regarding
Currently this inner type is in user space, which seems to cause problems with The problem here is that because the inner_type is in user space which errors if the user doesn't have
where |
Actually the bitflags create also creates everything in user space(macros) and it doesn't require the I'll look into it. Sorry for the back and forth, I haven't really done anything without the |
The trick here is
And then use |
I think we can't do that because it uses Look at my last commit, I resolved the issue with a feature. The only problem left is |
I don't meant that we should use it inside
Which means that we can do something like this inside
I got it working with the first version of your fork. Or at least it appears to be working. Do you want me to push the changes? |
Go ahead 👍 ! |
I replaced bitflags with it and it works perfect! |
Sorry, I think it's better to keep it open until it's merged. |
I pushed the changes to https://github.com/MaikKlein/enumflags/tree/no_std You can use it like this
I want to test it a bit more before I merge it with master. |
Any progress here? |
@aoowweenn Sorry for the delay, I refactored almost everything. The println should be gone now. |
Should be fixed in the latest released |
Removing
std
would allow its usage in embedded programming, or in environments where it isn't available.The text was updated successfully, but these errors were encountered: