From 685bba01491f83f7d95636b8e4f400bdd45e351b Mon Sep 17 00:00:00 2001 From: mibac138 <5672750+mibac138@users.noreply.github.com> Date: Mon, 17 May 2021 14:22:01 +0200 Subject: [PATCH] Make unreachable `width` actually unreachable Normally `width` is only called after `is_hidden` returns false but in the case of a `ProgressDrawTargetKind::Remote` it always returned false even if the draw target was actually hidden and because of it drawing did call `width` --- src/state.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/state.rs b/src/state.rs index 148bd6f7..eab726c4 100644 --- a/src/state.rs +++ b/src/state.rs @@ -444,7 +444,9 @@ impl ProgressDrawTarget { match self.kind { ProgressDrawTargetKind::Hidden => true, ProgressDrawTargetKind::Term { ref term, .. } => !term.is_term(), - _ => false, + ProgressDrawTargetKind::Remote { ref state, .. } => { + state.read().unwrap().draw_target.is_hidden() + } } }