2 releases

0.1.1 Apr 27, 2022
0.1.0 Apr 13, 2021

#3 in #c-string

36 downloads per month
Used in espeakng

MIT license

5KB

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

~195–590KB
~14K SLoC