Skip to content

Make this crate no_std #10

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

linkmauve
Copy link
Contributor

As nothing actually depends on std, there is no need to keep a dependency on it. This allows users such as the jid crate to actually be no_std as well.

@linkmauve
Copy link
Contributor Author

Ah oops, that works in nightly but doesn’t yet in stable, due to core::error::Error not being exported yet… I could add a std feature that would be default and impl this trait, just like in jid, or just keep that PR open until that export gets stabilised, which option do you prefer?

@sfackler
Copy link
Owner

I think a std feature seems reasonable. If it becomes a no-op in the future once Error-in-core stabilizes that's fine.

@linkmauve
Copy link
Contributor Author

There, I have added an optional but enabled by default std feature.

@sfackler
Copy link
Owner

Can you also update the CI logic to also test with the std feature disabled?

LGTM otherwise

As nothing actually depends on std, there is no need to keep a
dependency on it.  This allows users such as the jid crate to actually
be no_std as well.

Now that core::error::Error got stabilized, we don’t need anything from
std any longer, but this bumps the minimum supported Rust version to
1.81.0.
@linkmauve
Copy link
Contributor Author

Hi, sorry for the delay, but in the meantime core::error::Error got stabilized so I removed the std feature again. This now requires Rust 1.81.0, if this is too recent I can revert to the previous feature-based solution.

@sfackler
Copy link
Owner

I think it'd be safer to have an enabled-by-default std feature to avoid being blocked on adding future APIs that do require std. That'd also allow us today to continue to support older Rust versions by importing Error from std when enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants