From 6d93ceb910b4993719072d5bd4624a6aaa20fea8 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Tue, 5 Jun 2018 14:33:18 +0300 Subject: [PATCH] EpisodeWidget: Minor style change. --- hammond-gtk/src/widgets/episode.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hammond-gtk/src/widgets/episode.rs b/hammond-gtk/src/widgets/episode.rs index 6626a5c..b7cfde3 100644 --- a/hammond-gtk/src/widgets/episode.rs +++ b/hammond-gtk/src/widgets/episode.rs @@ -511,11 +511,9 @@ fn progress_bar_helper( // info!("Fraction: {}", fraction); // Check if the download is still active - let active = { - let m = manager::ACTIVE_DOWNLOADS - .read() - .map_err(|_| format_err!("Failed to get a lock on the mutex."))?; - m.contains_key(&episode_rowid) + let active = match manager::ACTIVE_DOWNLOADS.read() { + Ok(guard) => guard.contains_key(&episode_rowid), + Err(_) => return Err(format_err!("Failed to get a lock on the mutex.")), }; if (fraction >= 1.0) && (!fraction.is_nan()) {