-
Notifications
You must be signed in to change notification settings - Fork 4
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
no_std
support?
#10
Comments
It is definitely possible. Feel free to submit a PR if you want. |
Yeah, the main issues are:
The former in my tests can have |
I'd also be interested! One problem is that |
Latter could work, example of
So, we'd have no_std by default, and std as opt-in. Breaking change, sure, but it's the approach I've seen the most... And then for things like
which would be when Or for when we don't have
Personally, I'd rather have something that allows both environments to be used with the same code. |
Usually that's combined with
I agree. |
Oh, yeah - my crates do it the way I outlined, as by default they should run on I can't think of a way to solve the |
Sure! |
Added. It's part of a wider project, but I think I've limited your access scope to only the fork. |
@shymega @birkenfeld Indeed So changing the error type seems necessary. |
OK, so I've managed to swap out |
@birkenfeld My proposal is that we split the tasks between us, work on separate branches for each task, then merge into one branch, and I/you can submit a PR against this repo. Does that sound good? @liranringel You're welcome to be added to my fork if you want as well. |
I don't think Also, note that the proc-macro crate doesn't need to work on |
@liranringel are you fine with a MSRV of 1.45? Then we could drop proc-macro-hack. |
So one unfortunate point is that most of the |
Yes, it's ok.
Notice that we can still use ByteOrder to act on |
Great, MSRV 1.45 should simplify a bit.
Ok, so the internals would then have to differ quite a bit, one part using |
Yeah, I didn't think
OK. |
And yeah, I think this will take some work. @birkenfeld Are you planning to use features to not use
It didn't like that. No idea why. I think we should also have a look at upping the Cargo Rust edition to 2021, maybe? |
Never mind. I just saw you fixed that in the fork. By the way, you might have started on an older variant of my |
OK, so I'm now adding conditionals for using |
That looks correct. There is no need for a feature for "core".
That would dramatically increase MSRV, and there's no need for it. |
Alright, submitting to your branch now and pushing. if you have unmerged changes that affect that region, let me know and we can resolve conflicts. There is however a few errors transforming the variable
Sure, that's understandable. I've found |
Pushed. |
Possibly worth subscribing to for revisiting in the future: rust-lang/rfcs#2262 |
@birkenfeld I force-pushed an amended commit to your branch. Should have really squashed two commits. |
I had a thought - what about this crate? https://github.com/technocreatives/core2 I know depending on external crates may not be ideal, but this would really help with the |
Can you give an example to how it's useful? |
It's useful as it's a I've tested it on an XMODEM/YMODEM/ZMODEM I'm working on (WIP), and it compiles pretty well. The benefit for us is that we can either replace our uses of It's up to you really, but I feel that using Personally, my preference really would be to use |
I like the idea to use |
Problem is, you can't remove dependencies with feature flags. So |
Agreed. I think it should only be used on |
Hmm on the other when I think about it, it may require users of |
Surely if we introduce the usage of |
I'm not sure I understand you correctly. |
Sorry, I meant something like how I was then thinking that if we're approaching this issue with the introduction of features for std and From my tests, it looks like |
But if another library that also supports But again, for now you can submit a PR that makes it this way. New error type can be in another PR. |
I think I'd rather submit a PR that supports the |
This is my initial work so far - https://gist.github.com/shymega/328dd231fcd96711361996b6a739025b It compiles but doesn't pass tests. I haven't committed yet as I'd like it to pass tests - hence the diff. |
If the user assumed the type is IO error and return it and the return type is IO error, then different error type will cause a compilation error. |
Not sure I fully understand. Been working on this some more. The main issue is the macro not importing the |
For reference: 46f87c2 |
@shymega can you open a PR so I can give you feedback? And about what I said about the error type - using About the suggestion to add |
Sure, opening a PR now. I rebased the With the |
I made a mistake and opened the PR on the fork. I've since reopened this repo as of tonight. A bit stupid of me to not realise for this long! I'm hoping we can work through the PR, as then I can use it in my embedded firmware daemon. |
Hi,
I'm working on embedded firmware, and I need to use this crate for communicating
with the embedded microcontroller over UART. However, it needs to be used in
no_std
environment.I was wondering if there's any way to bring
no_std
support to this crate?Thanks!
The text was updated successfully, but these errors were encountered: