Skip to content

Commit

Permalink
fix compile warnings for some configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Sep 20, 2022
1 parent deb7791 commit fe0ac06
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/render/line/engine.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{progress, render::line::draw, Throughput, WeakRoot};
#[cfg(feature = "signal-hook")]
use std::sync::Arc;
use std::{
io,
Expand Down Expand Up @@ -179,8 +180,9 @@ impl Drop for JoinHandle {
#[derive(Debug)]
enum Event {
Tick,
Resize(u16, u16),
Quit,
#[cfg(feature = "signal-hook")]
Resize(u16, u16),
}

/// Write a line-based representation of `progress` to `out` which is assumed to be a terminal.
Expand All @@ -202,6 +204,7 @@ pub fn render(
throughput,
}: Options,
) -> JoinHandle {
#[cfg_attr(not(feature = "signal-hook"), allow(unused_mut))]
let mut config = draw::Options {
level_filter,
terminal_dimensions,
Expand Down Expand Up @@ -278,6 +281,7 @@ pub fn render(

for event in event_recv {
match event {
#[cfg(feature = "signal-hook")]
Event::Resize(x, y) => {
config.terminal_dimensions = (x, y);
draw::all(&mut out, SHOW_PROGRESS.load(Ordering::Relaxed), &mut state, &config)?;
Expand Down

0 comments on commit fe0ac06

Please sign in to comment.