From c5524113ff286682e0926bd3962190b826d603ce Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Wed, 23 Sep 2020 10:33:30 -0500 Subject: [PATCH] Document the fact that we only need an NSRunLoop in the example because there isn't one already. --- examples/hello_world.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/hello_world.rs b/examples/hello_world.rs index 9b1954b..4d7accd 100644 --- a/examples/hello_world.rs +++ b/examples/hello_world.rs @@ -61,6 +61,8 @@ fn main() -> Result<(), Error> { } tts.speak("Goodbye.", false)?; 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() };