choice_nocase

Crates.iochoice_nocase
lib.rschoice_nocase
version0.2.0
sourcesrc
created_at2023-10-10 21:13:39.682732
updated_at2023-11-04 16:38:27.697852
descriptionTransforms 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.
homepage
repositoryhttps://github.com/rgiot/choice_nocase
max_upload_size
id999486
size7,716
(rgiot)

documentation

README

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")
};
Commit count: 7

cargo fmt