const-str
compile-time string operations
Examples
assert_eq!;
assert_eq!;
assert_eq!;
feature regex
use Regex;
let re = verified_regex!;
assert!;
feature http
use HeaderName;
let name = verified_header_name!;
assert_eq!;
compile-time string operations
assert_eq!(const_str::to_lowercase!("HELLO"), "hello");
assert_eq!(const_str::to_uppercase!("hello"), "HELLO");
assert_eq!(const_str::replace!("this is old", "old", "new"), "this is new");
feature regex
use regex::Regex;
let re = const_str::verified_regex!(r"^\d{4}-\d{2}-\d{2}$");
assert!(Regex::new(re).is_ok());
feature http
use http::header::HeaderName;
let name = const_str::verified_header_name!("content-md5");
assert_eq!(HeaderName::from_static(name).as_str(), "content-md5");