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

Commit

Permalink
Add deprecation note to README
Browse files Browse the repository at this point in the history
  • Loading branch information
upsuper committed Mar 23, 2024
1 parent 4af2511 commit 306279e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cstr"
version = "0.2.11"
version = "0.2.12"
authors = ["Xidorn Quan <me@upsuper.org>"]
description = "Macro for building static CStr reference"
repository = "https://github.com/upsuper/cstr"
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@

<!-- cargo-sync-readme start -->

**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

Expand Down
10 changes: 9 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -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
//!
Expand Down

0 comments on commit 306279e

Please sign in to comment.