Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Literal C String
A procedural macro for making literal C strings.
Problem
I was tired of typing the following:
let s = new.unwrap;
Ideally, I would be able to do something similar to the syntax of a byte string c"Hello, world!"
but that requires a language change.
Solution
I decided to create a macro that is close enough.
let s = c!;
Installation
Currently requires a nightly build of rust. Use rustc 1.28.0 (9634041f0 2018-07-30)
or newer.
[]
= "0.6"
extern crate literal_cstr;
use c;
Procedural macros are stable, but #![feature(proc_macro_non_items)]
is required in order to use the macro with a literal string expression.
Usage
let s = c!;
Check out /examples/show.rs for a full example.
Tests
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.