cstr icon indicating copy to clipboard operation
cstr copied to clipboard

Supporting no_std

Open chrysn opened this issue 3 years ago • 2 comments
trafficstars

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.

chrysn avatar Jul 19 '22 10:07 chrysn

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 avatar Jul 19 '22 11:07 upsuper

That is to say, PR welcome :)

upsuper avatar Jul 19 '22 11:07 upsuper