#const #str #string #c #cstr #time #compile

const-c-str

Safely create &CStr at compile time

2 releases

✓ Uses Rust 2018 edition

0.1.1 Mar 6, 2019
0.1.0 Mar 5, 2019

#86 in FFI

Download history 3/week @ 2019-02-27

4 downloads per month

MIT/Apache

2KB


lib.rs:

Safely create &CStr at compile time checked with from_bytes_with_nul

Examples

use const_c_str::c_str;

#[cfg(feature = "const_cstr_unchecked")]
const greeting: &std::ffi::CStr = c_str!("Hello World!");

Dependencies

~798KB
~18K SLoC