File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- use dialoguer:: { theme:: ColorfulTheme , FuzzySelect } ;
2-
3- fn main ( ) {
4- let selections = & [
5- "Ice Cream" ,
6- "Vanilla Cupcake" ,
7- "Chocolate Muffin" ,
8- "A Pile of sweet, sweet mustard" ,
9- "Carrots" ,
10- "Peas" ,
11- "Pistacio" ,
12- "Mustard" ,
13- "Cream" ,
14- "Banana" ,
15- "Chocolate" ,
16- "Flakes" ,
17- "Corn" ,
18- "Cake" ,
19- "Tarte" ,
20- "Cheddar" ,
21- "Vanilla" ,
22- "Hazelnut" ,
23- "Flour" ,
24- "Sugar" ,
25- "Salt" ,
26- "Potato" ,
27- "French Fries" ,
28- "Pizza" ,
29- "Mousse au chocolat" ,
30- "Brown sugar" ,
31- "Blueberry" ,
32- "Burger" ,
33- ] ;
34-
35- let selection = FuzzySelect :: with_theme ( & ColorfulTheme :: default ( ) )
36- . with_prompt ( "Pick your flavor" )
37- . default ( 0 )
38- . items ( & selections[ ..] )
39- . interact ( )
40- . unwrap ( ) ;
41-
42- println ! ( "Enjoy your {}!" , selections[ selection] ) ;
43- }
1+ use dialoguer:: { theme:: ColorfulTheme , FuzzySelect } ;
2+
3+ fn main ( ) {
4+ let selections = & [
5+ "Ice Cream" ,
6+ "Vanilla Cupcake" ,
7+ "Chocolate Muffin" ,
8+ "A Pile of sweet, sweet mustard" ,
9+ "Carrots" ,
10+ "Peas" ,
11+ "Pistacio" ,
12+ "Mustard" ,
13+ "Cream" ,
14+ "Banana" ,
15+ "Chocolate" ,
16+ "Flakes" ,
17+ "Corn" ,
18+ "Cake" ,
19+ "Tarte" ,
20+ "Cheddar" ,
21+ "Vanilla" ,
22+ "Hazelnut" ,
23+ "Flour" ,
24+ "Sugar" ,
25+ "Salt" ,
26+ "Potato" ,
27+ "French Fries" ,
28+ "Pizza" ,
29+ "Mousse au chocolat" ,
30+ "Brown sugar" ,
31+ "Blueberry" ,
32+ "Burger" ,
33+ ] ;
34+
35+ let selection = FuzzySelect :: with_theme ( & ColorfulTheme :: default ( ) )
36+ . with_prompt ( "Pick your flavor" )
37+ . default ( 0 )
38+ . items ( & selections[ ..] )
39+ . interact ( )
40+ . unwrap ( ) ;
41+
42+ println ! ( "Enjoy your {}!" , selections[ selection] ) ;
43+ }
You can’t perform that action at this time.
0 commit comments