Skip to content

rgiot/choice_nocase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Transforms a string as a list of strings separated by `|`` where all combinations of character cases are generated. By construction first one is fully uppercase, second one is fully lowercase.

The following call:

match value.as_ref() {
	choice_nocase!("hi") => println!("good"),
	_ => println!("bad")
};

corresponds to a similar macro expansion:

match value.as_ref() {
	"HI" | "hi" | "Hi" | "hI" => println!("good"),
	_ => println!("bad")
};

About

proc_macro to transform a literal string as a list of choice of literal string were all case variation are present

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages