aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mumctl/src/main.rs10
-rw-r--r--mumd/src/audio.rs13
-rw-r--r--mumd/src/network/tcp.rs8
-rw-r--r--mumd/src/notify.rs2
-rw-r--r--mumlib/src/command.rs1
-rw-r--r--mumlib/src/config.rs8
6 files changed, 21 insertions, 21 deletions
diff --git a/mumctl/src/main.rs b/mumctl/src/main.rs
index 298c04f..a3a1a06 100644
--- a/mumctl/src/main.rs
+++ b/mumctl/src/main.rs
@@ -191,10 +191,10 @@ fn main() {
let stdin = std::io::stdin();
let response = stdin.lock().lines().next();
if let Some(Ok(true)) = response.map(|e| e.map(|e| &e == "Y")) {
- config.write_default_cfg(true).unwrap();
+ config.write_default_cfg(true).unwrap(); //TODO handle panic
}
} else {
- config.write_default_cfg(false).unwrap();
+ config.write_default_cfg(false).unwrap(); //TODO handle panic
}
}
@@ -276,13 +276,13 @@ fn process_matches(matches: ArgMatches, config: &mut Config, app: &mut App) -> R
match name {
"audio.input_volume" => {
if let Ok(volume) = value.parse() {
- send_command(Command::InputVolumeSet(volume))?.unwrap();
+ send_command(Command::InputVolumeSet(volume))?.unwrap(); //TODO error_if_err
config.audio.input_volume = Some(volume);
}
}
"audio.output_volume" => {
if let Ok(volume) = value.parse() {
- send_command(Command::OutputVolumeSet(volume))?.unwrap();
+ send_command(Command::OutputVolumeSet(volume))?.unwrap(); //TODO error_if_err
config.audio.output_volume = Some(volume);
}
}
@@ -291,7 +291,7 @@ fn process_matches(matches: ArgMatches, config: &mut Config, app: &mut App) -> R
}
}
} else if matches.subcommand_matches("config-reload").is_some() {
- send_command(Command::ConfigReload)?.unwrap();
+ send_command(Command::ConfigReload)?.unwrap(); //TODO error_if_err
} else if let Some(matches) = matches.subcommand_matches("completions") {
app.gen_completions_to(
"mumctl",
diff --git a/mumd/src/audio.rs b/mumd/src/audio.rs
index 6b46a7a..1e231e2 100644
--- a/mumd/src/audio.rs
+++ b/mumd/src/audio.rs
@@ -102,7 +102,7 @@ impl Audio {
None
}
})
- .unwrap()
+ .unwrap() //TODO handle panic
.with_sample_rate(sample_rate);
let output_supported_sample_format = output_supported_config.sample_format();
let output_config: StreamConfig = output_supported_config.into();
@@ -120,7 +120,7 @@ impl Audio {
None
}
})
- .unwrap()
+ .unwrap() //TODO handle panic
.with_sample_rate(sample_rate);
let input_supported_sample_format = input_supported_config.sample_format();
let input_config: StreamConfig = input_supported_config.into();
@@ -164,7 +164,7 @@ impl Audio {
err_fn,
),
}
- .unwrap();
+ .unwrap(); //TODO handle panic
let (sample_sender, sample_receiver) = futures_channel::mpsc::channel(1_000_000);
@@ -199,7 +199,7 @@ impl Audio {
err_fn,
),
}
- .unwrap();
+ .unwrap(); //TODO handle panic
let opus_stream = OpusEncoder::new(
4,
@@ -217,7 +217,7 @@ impl Audio {
position_info: None,
});
- output_stream.play().unwrap();
+ output_stream.play().unwrap(); //TODO handle panic?
let mut res = Self {
output_config,
@@ -268,7 +268,7 @@ impl Audio {
let iter: Box<dyn Iterator<Item = f32>> = match spec.channels {
1 => Box::new(samples.into_iter().flat_map(|e| vec![e, e])),
2 => Box::new(samples.into_iter()),
- _ => unimplemented!() // TODO handle gracefully (this might not even happen)
+ _ => unimplemented!() // TODO handle panic (if speaker is surround speaker)
};
let mut signal = signal::from_interleaved_samples_iter::<_, [f32; 2]>(iter);
let interp = Linear::new(Signal::next(&mut signal), Signal::next(&mut signal));
@@ -401,4 +401,3 @@ fn get_sfx(file: &str) -> Cow<'static, [u8]> {
fn get_default_sfx() -> Cow<'static, [u8]> {
Cow::from(include_bytes!("fallback_sfx.wav").as_ref())
}
-
diff --git a/mumd/src/network/tcp.rs b/mumd/src/network/tcp.rs
index 47b1c20..09cd844 100644
--- a/mumd/src/network/tcp.rs
+++ b/mumd/src/network/tcp.rs
@@ -177,7 +177,7 @@ async fn authenticate(
msg.set_password(password);
}
msg.set_opus(true);
- sink.send(msg.into()).await.unwrap();
+ sink.send(msg.into()).await.unwrap(); //TODO handle panic
}
async fn send_pings(
@@ -189,7 +189,7 @@ async fn send_pings(
interval.tick().await;
trace!("Sending TCP ping");
let msg = msgs::Ping::new();
- packet_sender.send(msg.into()).unwrap();
+ packet_sender.send(msg.into()).unwrap(); //TODO handle panic
}
}
@@ -198,8 +198,8 @@ async fn send_packets(
packet_receiver: &mut mpsc::UnboundedReceiver<ControlPacket<Serverbound>>,
) {
loop {
- let packet = packet_receiver.recv().await.unwrap();
- sink.send(packet).await.unwrap();
+ let packet = packet_receiver.recv().await.unwrap(); //TODO handle panic
+ sink.send(packet).await.unwrap(); //TODO handle panic
}
}
diff --git a/mumd/src/notify.rs b/mumd/src/notify.rs
index ee387cc..66a0faf 100644
--- a/mumd/src/notify.rs
+++ b/mumd/src/notify.rs
@@ -1,6 +1,6 @@
pub fn init() {
#[cfg(feature = "notifications")]
- libnotify::init("mumd").unwrap();
+ libnotify::init("mumd").unwrap(); //TODO handle panic (don't send notifications)
}
#[cfg(feature = "notifications")]
diff --git a/mumlib/src/command.rs b/mumlib/src/command.rs
index d2e8477..fc08ddf 100644
--- a/mumlib/src/command.rs
+++ b/mumlib/src/command.rs
@@ -31,6 +31,7 @@ pub enum Command {
UserVolumeSet(String, f32),
}
+//TODO none-response
#[derive(Debug, Deserialize, Serialize)]
pub enum CommandResponse {
ChannelList {
diff --git a/mumlib/src/config.rs b/mumlib/src/config.rs
index 0a43253..b0ce3f7 100644
--- a/mumlib/src/config.rs
+++ b/mumlib/src/config.rs
@@ -41,7 +41,7 @@ impl Config {
fs::write(
path,
- toml::to_string(&TOMLConfig::from(self.clone())).unwrap(),
+ toml::to_string(&TOMLConfig::from(self.clone())).unwrap(), //TODO handle panic
)
}
}
@@ -162,7 +162,7 @@ impl From<Config> for TOMLConfig {
config
.servers
.into_iter()
- .map(|s| Value::try_from::<ServerConfig>(s).unwrap())
+ .map(|s| Value::try_from::<ServerConfig>(s).unwrap()) //TODO handle panic
.collect(),
),
}
@@ -175,7 +175,7 @@ pub fn read_default_cfg() -> Config {
Ok(f) => f,
Err(_) => return Config::default(),
})
- .expect("invalid TOML in config file"), //TODO
+ .expect("invalid TOML in config file"), //TODO handle panic
)
- .expect("invalid config in TOML") //TODO
+ .expect("invalid config in TOML") //TODO handle panic
}