-
Notifications
You must be signed in to change notification settings - Fork 27
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 feature; impl Display on Error #19
Conversation
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.
Thank you!
with-mbed-crypto = ["psa-crypto-sys"] | ||
no-std = [] |
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.
How would one compile this crate with only the no-std
feature activated? Would it be like:
cargo build --no-default-features --features no-std
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.
Yes, precisely!
@@ -89,6 +94,73 @@ pub enum Error { | |||
InvalidHandle, | |||
} | |||
|
|||
#[cfg(not(feature = "no-std"))] | |||
impl fmt::Display for Error { |
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 👏
This commit adds a no-std feature that controls whether the crate exposes any functionality that makes use of the standard library. The feature is enabled by default. In "std"-mode, the Display and Error traits are implemented on the `Error` enum. Signed-off-by: Ionut Mihalcea <[email protected]>
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 commit adds a no-std feature that controls whether the crate
exposes any functionality that makes use of the standard library. The
feature is enabled by default.
In "std"-mode, the Display and Error traits are implemented on the
Error
enum.Signed-off-by: Ionut Mihalcea [email protected]