From f37133841a1f0df4815b3445bf6c04c7cc0572a1 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 17 Nov 2020 16:00:02 -0600 Subject: [PATCH] Fix warnings. --- examples/ramble.rs | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/examples/ramble.rs b/examples/ramble.rs index 36265e7..85bde46 100644 --- a/examples/ramble.rs +++ b/examples/ramble.rs @@ -1,13 +1,5 @@ -use std::io; use std::{thread, time}; -#[cfg(target_os = "macos")] -use cocoa_foundation::base::id; -#[cfg(target_os = "macos")] -use cocoa_foundation::foundation::NSRunLoop; -#[cfg(target_os = "macos")] -use objc::{msg_send, sel, sel_impl}; - use tts::*; fn main() -> Result<(), Error> { @@ -15,21 +7,9 @@ fn main() -> Result<(), Error> { let mut tts = TTS::default()?; let mut phrase = 1; loop { - tts.speak(format!("Phrase {}", phrase), false); + tts.speak(format!("Phrase {}", phrase), false)?; let time = time::Duration::from_secs(5); thread::sleep(time); phrase += 1; } - let mut _input = String::new(); - // The below is only needed to make the example run on MacOS because there is no NSRunLoop in this context. - // It shouldn't be needed in an app or game that almost certainly has one already. - #[cfg(target_os = "macos")] - { - let run_loop: id = unsafe { NSRunLoop::currentRunLoop() }; - unsafe { - let _: () = msg_send![run_loop, run]; - } - } - io::stdin().read_line(&mut _input)?; - Ok(()) }