From d6b1d36c6edaac986751c67972de1feec3098725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 21 Jan 2023 21:56:42 +1300 Subject: [PATCH] Avoid looping in demo (#486) --- crates/lib/examples/demo.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/lib/examples/demo.rs b/crates/lib/examples/demo.rs index edc5634..1e6e7b6 100644 --- a/crates/lib/examples/demo.rs +++ b/crates/lib/examples/demo.rs @@ -56,7 +56,7 @@ async fn main() -> Result<()> { eprintln!("Switching to polling for funsies"); config.file_watcher(Watcher::Poll(Duration::from_millis(50))); w.reconfigure(config)?; - } else { + } else if (action.events.iter().flat_map(Event::paths).next().is_some()) { action.outcome(Outcome::if_running( Outcome::both(Outcome::Stop, Outcome::Start), Outcome::Start,