commit 2bc5c9422925235c0dd8004a921756d6c24e217b
parent 63bac191351f32b0eec9a1e5c254bcc8e32c5af6
Author: Alex Balgavy <alex@balgavy.eu>
Date: Wed, 22 Jun 2022 11:40:53 +0200
Add a todo
Diffstat:
1 file changed, 25 insertions(+), 0 deletions(-)
diff --git a/src/radio.rs b/src/radio.rs
@@ -2,11 +2,36 @@ use crate::config::*;
use serde::Deserialize;
use std::process::Command;
+/* TODO:
+ * Radio struct has /either/ (url && mpc load option) or (radios)
+ * Make an enum containing values for that.
+ *
+ * Radios can be a Vec<Radio>, or a function returning Vec<Radio>.
+ * Should use an enum with values for that:
+ *
+ * enum Things { Num(i64), Func(fn()) }
+ * fn doit() { println!("We in function"); }
+ *
+ * fn main() {
+ * let i = Things::Num(42);
+ * if let Things::Num(v) = i {
+ * dbg!(v);
+ * }
+ *
+ * let f = Things::Func(doit);
+ * if let Things::Func(thefunc) = f {
+ * thefunc();
+ * }
+ * }
+ */
#[derive(Deserialize, Debug)]
pub struct Radio {
pub name: String,
+
+ // TODO: description & website shouldn't be exclusive
pub description: Option<String>,
pub website: Option<String>,
+
#[serde(alias = "sound")]
pub url: Option<String>,
pub mpc_load_option: Option<MpcLoadOptions>,