-
Notifications
You must be signed in to change notification settings - Fork 6
/
list.rs
80 lines (78 loc) · 2.09 KB
/
list.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
use std::io;
use demand::List;
fn main() {
let list = List::new("Toppings")
.description("List of available toppings")
.item("Lettuce")
.item("Tomatoes")
.item("Charm Sauce")
.item("Jalapenos")
.item("Cheese")
.item("Vegan Cheese")
.item("Nutella")
.item("Peanut Butter")
.item("Banana")
.item("Strawberries")
.item("Blueberries")
.item("Pineapple")
.item("Mango")
.item("Kiwi")
.item("Passion Fruit")
.item("Peaches")
.item("Raspberries")
.item("Blackberries")
.item("Mint")
.item("Chocolate Chips")
.item("Oreos")
.item("Brownie Bites")
.item("Cookie Dough")
.item("Graham Cracker Crumbs")
.item("M&Ms")
.item("Reese's Pieces")
.item("Butterfinger")
.item("Heath Bar")
.item("Kit Kat")
.item("Snickers")
.item("Twix")
.item("Caramel")
.item("Hot Fudge")
.item("Marshmallow")
.item("Whipped Cream")
.item("Chocolate Syrup")
.item("Caramel Syrup")
.item("Strawberry Syrup")
.item("Peanut Butter Syrup")
.item("Nutella Syrup")
.item("Honey")
.item("Sprinkles")
.item("Chocolate Sprinkles")
.item("Coconut Flakes")
.item("Almonds")
.item("Peanuts")
.item("Walnuts")
.item("Pecans")
.item("Cashews")
.item("Pistachios")
.item("Macadamia Nuts")
.item("Hazelnuts")
.item("Peanut Butter Cups")
.item("Gummy Bears")
.item("Sour Patch Kids")
.item("Sour Gummy Worms")
.item("Sour Skittles")
.item("Skittles")
.item("Starburst")
.item("Twizzlers")
.item("Milk Duds")
.filterable(true);
match list.run() {
Ok(_) => {}
Err(e) => {
if e.kind() == io::ErrorKind::Interrupted {
println!("Input cancelled");
} else {
panic!("Error: {}", e);
}
}
};
}