2 releases

0.1.1 Apr 27, 2022
0.1.0 Apr 13, 2021

#10 in #c-strings

Download history 3/week @ 2024-01-08 11/week @ 2024-02-19 25/week @ 2024-02-26 15/week @ 2024-03-04 22/week @ 2024-03-11 14/week @ 2024-03-18 23/week @ 2024-03-25 56/week @ 2024-04-01 8/week @ 2024-04-08 6/week @ 2024-04-15

94 downloads per month
Used in espeakng

MIT license

6KB

zstr!: Zero-terminated C string literals

This crate provides a minimal, safe, zero-cost function-like procedural macro, zstr!(), that creates 0-terminated &'static CStr values from regular Rust string (or byte string) literals.

The basic usage is:

let c_str = zstr!("Hello World!");

See the documentation for more examples.


lib.rs:

Zero-terminated C string literals.

Dependencies

~1.5MB
~34K SLoC