forestrie 0.3.1

Quick string matches
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[derive(Debug, PartialEq)]
struct N(u8);

#[test]
fn full() {
	let non_clone = N(8);
	let n = forestrie::exact! {
		match "red" {
			"blue" => N(5),
			"red" | "green" => N(12),
			c"orange" => N(7),
			"grass" | "yellow" => non_clone,
			"" => N(1),
			_ => N(9),
		}
	};
	assert_eq!(n, N(12));
}