Sugested changes
@@ -549,13 +549,14 @@ mod backtrace {
}
}
-fn play_scream() -> Option<()> {
+#[cfg(feature = "salty")]
+fn play_scream() -> Result<(), ()> {
const SCREAM: &[u8] = include_bytes!("data/R2D2-Scream.ogg");
- let device = rodio::default_output_device()?;
- let source = rodio::Decoder::new(std::io::Cursor::new(SCREAM)).ok()?;
+ let device = rodio::default_output_device().ok_or(())?;
+ let source = rodio::Decoder::new(std::io::Cursor::new(SCREAM)).or(Err(()))?;
rodio::play_raw(&device, rodio::source::Source::convert_samples(source));
std::thread::sleep(std::time::Duration::from_millis(2835));
- Some(())
+ Ok(())
}
#[cfg(feature = "salty")]
