Skip to content
/ chstr Public

A macro to convert a char array into a string at compile time.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

Juici/chstr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wchar

crates.io docs.rs

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.

About

A macro to convert a char array into a string at compile time.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages