From b454a7fcac66aaeec3a6ea6f5bce23fb701fd761 Mon Sep 17 00:00:00 2001 From: Alexandre Franke Date: Sat, 27 Apr 2019 17:48:21 +0200 Subject: [PATCH] rust: simplify loop code --- fractal-gtk/src/app/backend_loop.rs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/fractal-gtk/src/app/backend_loop.rs b/fractal-gtk/src/app/backend_loop.rs index 6e7b5a9f..e8920a54 100644 --- a/fractal-gtk/src/app/backend_loop.rs +++ b/fractal-gtk/src/app/backend_loop.rs @@ -16,26 +16,15 @@ use std::sync::mpsc::RecvError; pub fn backend_loop(rx: Receiver) { thread::spawn(move || { - let mut shutting_down = false; loop { let recv = rx.recv(); - if let Err(RecvError) = recv { - // stopping this backend loop thread - break; - } - - if shutting_down { - // ignore this event, we're shutting down this thread - continue; - } - match recv { Err(RecvError) => { break; } Ok(BKResponse::ShutDown) => { - shutting_down = true; + break; } Ok(BKResponse::Token(uid, tk, dev)) => { APPOP!(bk_login, (uid, tk, dev));