Skip to content

Procedural macro in Rust for compile-time find/replace on string literals

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

JarredAllen/string-literal-const-replace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

string-literal-const-replace

This is a proc macro which allows you to, at compile time, perform find/replace on string literals. This macro is intended to be called by other macros, to do processing on inputs provided to the macro.

Note that this macro is nightly-only as it relies on the proc_macro_expand unstable feature.

Example of use:

assert_eq!(
    string_literal_replace!("hello, world!" ("hello" -> "goodbye")),
    "goodbye, world!"
);

About

Procedural macro in Rust for compile-time find/replace on string literals

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-Apache
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages