Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Supporting no_std #12

Closed
chrysn opened this issue Jul 19, 2022 · 2 comments · Fixed by #14
Closed

Supporting no_std #12

chrysn opened this issue Jul 19, 2022 · 2 comments · Fixed by #14

Comments

@chrysn
Copy link
Contributor

chrysn commented Jul 19, 2022

core::ffi::CStr and alloc::ffi::CString have been stabilized for Rust 1.64, which is due to become stable in 9 weeks from now.

Would you consider making this crate no_std? AIU all it'd need to do is to

  • lib.rs needs a #![cfg_attr(not(proc_macro), no_std)]
  • guard content in lib.rs with #[cfg(proc_macro)]. Given that it's almost every line that needs guarding, this might best be done by moving code from src/lib.rs into a module.
  • change the quoted ::std::ffi::CStr to `::core::ffi::CStr``.

I can offer a PR, but it's probably all more a matter of chosen style and how to handle the MSRV increase than of the actual change.

@upsuper
Copy link
Owner

upsuper commented Jul 19, 2022

This crate doesn't have a MSRV policy, and I would simply be tracing the latest stable version. I think the code of this crate should be stable enough that anyone needs to support an old version can just pin to an old version of this crate without having much problem.

@upsuper
Copy link
Owner

upsuper commented Jul 19, 2022

That is to say, PR welcome :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants