chstr 0.1.0

A macro to convert a character array into a string at compile time.
Documentation
  • Coverage
  • 50%
    1 out of 2 items documented1 out of 1 items with examples
  • Size
  • Source code size: 18.49 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 496.77 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Juici/chstr
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Juici

wchar

This library provides a macro to convert a sequence of characters into a string at compile time.

[dependencies]
chstr = "0.1"

Compiler support: requires rustc 1.57+

Examples

Basic usage:

const ABC: &str = chstr!['a', 'b', 'c'];

assert_eq!(ABC, "abc");

Directory separator:

const SEPARATOR_CHAR: char = std::path::MAIN_SEPARATOR;
const SEPARATOR: &str = chstr![SEPARATOR_CHAR];

let mut chars = SEPARATOR.chars();
assert_eq!(chars.next(), Some(SEPARATOR_CHAR));
assert_eq!(chars.next(), None);

License

This project is licensed under either of Apache License, Version 2.0 or MIT License 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.