#upper-case #lower-case #generated #character #list #hi #all-combinations

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

#16 in #hi

Download history 19/week @ 2025-08-13 35/week @ 2025-08-20 48/week @ 2025-08-27 92/week @ 2025-09-03 41/week @ 2025-09-10 32/week @ 2025-09-17 47/week @ 2025-09-24 43/week @ 2025-10-01 30/week @ 2025-10-08 55/week @ 2025-10-15 72/week @ 2025-10-22 33/week @ 2025-10-29 39/week @ 2025-11-05 34/week @ 2025-11-12 42/week @ 2025-11-19

160 downloads per month
Used in 14 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

~150–550KB
~13K SLoC