summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index fa1f37f..76294b9 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,11 +1,16 @@
+use inquire::{InquireError, Select};
use spinners::{Spinner, Spinners};
+use crate::channels::Channel;
+
mod channels;
fn main() {
let mut sp = Spinner::new(Spinners::Dots, "Loading SomaFM channels...".into());
let channels = channels::get_channels();
sp.stop();
- let groove_salad = channels.iter().find(|c| c.id == "groovesalad").unwrap();
- println!("\n{:?}", groove_salad);
+
+ let ans: Result<Channel, InquireError> = Select::new("Select a channel", channels).prompt();
+
+ println!("\n{:?}", ans);
}