#second #string #lower-case #transform #upper-case #list #character

nightly macro choice_nocase

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.

3 unstable releases

0.2.0 Nov 4, 2023
0.1.2 Oct 10, 2023
0.1.1 Oct 10, 2023

#15 in #upper-case

Download history 4/week @ 2024-07-20 8/week @ 2024-07-27 34/week @ 2024-08-03 20/week @ 2024-08-10 29/week @ 2024-08-17 25/week @ 2024-08-24 43/week @ 2024-08-31 15/week @ 2024-09-07 20/week @ 2024-09-14 52/week @ 2024-09-21 26/week @ 2024-09-28 5/week @ 2024-10-05 23/week @ 2024-10-12 12/week @ 2024-10-19 9/week @ 2024-10-26 23/week @ 2024-11-02

67 downloads per month
Used in 9 crates (via cpclib-asm)

MIT license

7KB
91 lines

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

Dependencies

~260–700KB
~17K SLoC