Making core no_std compatible#94
Conversation
|
For what I've checked, snafu has it's own |
Mhmm! The main reason behind wanting to explore |
|
@pranav-bhatt you need to configure the ci to run the no_std builds/tests too |
| @@ -0,0 +1,208 @@ | |||
| //! https://docs.rs/not-io/0.1.0-alpha/not_io/ | |||
There was a problem hiding this comment.
This basically is a work around for std::io::Error and std::io::Result<>. If you're asking about the link, then I forgot to remove it :P
There was a problem hiding this comment.
Well, why we need io::Error? Can you just disable it in no_std envs?
| @@ -1,4 +1,5 @@ | |||
| use chrono::{DateTime, Utc}; | |||
| use std::prelude::v1::*; | |||
There was a problem hiding this comment.
Can we enable these imports around the sdk only if the no_std feature is enabled?
slinkydeveloper
left a comment
There was a problem hiding this comment.
In the Cargo.toml, you need to define the std feature, like in https://github.com/KodrAus/rust-no-std/blob/master/Cargo.toml and https://github.com/shepmaster/snafu/blob/master/Cargo.toml and enable it by default.
Then try to create an embedded project in your machine and try to import this library
Cargo.toml
Outdated
| url = { version = "^2.1", features = ["serde"] } | ||
| snafu = "^0.6" | ||
|
|
||
| #[dependencies.snafu] |
There was a problem hiding this comment.
In case of no_std env, you need to import snafu like below (no need to include guide feature)
src/message/error.rs
Outdated
| Other { | ||
| source: Box<dyn std::error::Error + Send + Sync>, | ||
| }, | ||
| IOError { source: super::no_std_io::Error }, |
There was a problem hiding this comment.
I don't think we need this variant (and the one below) in no_std envs
|
Can you rebase? |
|
@pranav-bhatt you should look at this #107 |
|
@pranav-bhatt can you start cleaning up this pr removing history files etc and rebasing with master? This branch diverged quite a bit from master |
Signed-off-by: adpranavb2000@gmail.com <adpranavb2000@gmail.com>
Signed-off-by: adpranavb2000@gmail.com <adpranavb2000@gmail.com>
Signed-off-by: adpranavb2000@gmail.com <adpranavb2000@gmail.com>
Signed-off-by: adpranavb2000@gmail.com <adpranavb2000@gmail.com>
Signed-off-by: adpranavb2000@gmail.com <adpranavb2000@gmail.com>
Signed-off-by: adpranavb2000@gmail.com <adpranavb2000@gmail.com>
#72
Things left to do:
DisplayError(chrono example, serde-json example), and generally clean uperror.rs