From 306279e3fcd669293da795880f59a01f706eebd7 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Sat, 23 Mar 2024 21:39:28 +1100 Subject: [PATCH] Add deprecation note to README --- Cargo.toml | 2 +- README.md | 10 +++++++++- src/lib.rs | 10 +++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0f325af..b53c132 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cstr" -version = "0.2.11" +version = "0.2.12" authors = ["Xidorn Quan "] description = "Macro for building static CStr reference" repository = "https://github.com/upsuper/cstr" diff --git a/README.md b/README.md index a81e222..849f90a 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,20 @@ +**This crate has been deprecated. +Rust 1.77.0 stabilized [C-string literals][c-string-literal]. +From that version, `c"abc"` can be used in place of `cstr!("abc")` provided by this crate. +This new feature gives more concise code and faster compilation. +Hence, this crate will no longer be maintained.** + +[c-string-literal]: https://blog.rust-lang.org/2024/03/21/Rust-1.77.0.html#c-string-literals + A macro for getting `&'static CStr` from literal or identifier. This macro checks whether the given literal is valid for `CStr` at compile time, and returns a static reference of `CStr`. -This macro can be used to to initialize constants. +This macro can be used to initialize constants. ## Example diff --git a/src/lib.rs b/src/lib.rs index cc35d5e..deccd31 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,9 +1,17 @@ +//! **This crate has been deprecated. +//! Rust 1.77.0 stabilized [C-string literals][c-string-literal]. +//! From that version, `c"abc"` can be used in place of `cstr!("abc")` provided by this crate. +//! This new feature gives more concise code and faster compilation. +//! Hence, this crate will no longer be maintained.** +//! +//! [c-string-literal]: https://blog.rust-lang.org/2024/03/21/Rust-1.77.0.html#c-string-literals +//! //! A macro for getting `&'static CStr` from literal or identifier. //! //! This macro checks whether the given literal is valid for `CStr` //! at compile time, and returns a static reference of `CStr`. //! -//! This macro can be used to to initialize constants. +//! This macro can be used to initialize constants. //! //! ## Example //!