Skip to content

connerebbinghaus/ascii-literal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ascii-literal

A proc-macro to make compile-time checked AsciiStrs.

Examples

This compiles just fine, and works as you would expect.

use ascii_literal::ascii_literal;
const MESSAGE: &ascii::AsciiStr = ascii_literal!("Hello in ASCII!");
println!("{}", MESSAGE); // Prints "Hello in ASCII!"

This, however, will give a compile time error.

use ascii_literal::ascii_literal;
// This doesn't compile!
const NOT_ASCII: &ascii::AsciiStr = ascii_literal!("Boom! 💥");

About

Compile time checked ASCII strings in Rust.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages