summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRupert Rutledge <eosis2 [at] gmail.com>2020-04-26 14:15:11 +0100
committerRupert Rutledge <eosis2 [at] gmail.com>2020-04-26 14:15:11 +0100
commit5cb0c7690a098c40400f7d3ca18db789eadaeb5f (patch)
treebad6e9da0ae153f0785d2186334e3a35df1404e2
parent1953c8bb8b7ec3a84e1b238421c0320f9e0b3391 (diff)
Running cargo fmt
-rw-r--r--src/display/components/total_bandwidth.rs8
-rw-r--r--src/main.rs22
2 files changed, 18 insertions, 12 deletions
diff --git a/src/display/components/total_bandwidth.rs b/src/display/components/total_bandwidth.rs
index 311ce67..844fb2a 100644
--- a/src/display/components/total_bandwidth.rs
+++ b/src/display/components/total_bandwidth.rs
@@ -51,10 +51,12 @@ impl<'a> TotalBandwidth<'a> {
(self.elapsed_time.as_secs() % 3600) / 60,
self.elapsed_time.as_secs() % 60
),
- Style::default().fg(Color::LightBlue).modifier(Modifier::BOLD),
+ Style::default()
+ .fg(Color::LightBlue)
+ .modifier(Modifier::BOLD),
)];
Paragraph::new(elapsed_time_text.iter())
- .alignment(Alignment::Right)
- .render(frame, rect);
+ .alignment(Alignment::Right)
+ .render(frame, rect);
}
}
diff --git a/src/main.rs b/src/main.rs
index 50cdf16..d4dfb31 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -150,7 +150,11 @@ where
on_winch({
Box::new(move || {
let mut ui = ui.lock().unwrap();
- ui.draw(paused.load(Ordering::SeqCst), dns_shown, std::time::Duration::new(131, 0));
+ ui.draw(
+ paused.load(Ordering::SeqCst),
+ dns_shown,
+ std::time::Duration::new(131, 0),
+ );
})
});
}
@@ -196,7 +200,8 @@ where
let elapsed_time = if paused {
cumulative_time.lock().unwrap().clone()
} else {
- *cumulative_time.lock().unwrap() + last_start_time.lock().unwrap().elapsed()
+ *cumulative_time.lock().unwrap()
+ + last_start_time.lock().unwrap().elapsed()
};
if raw_mode {
@@ -238,13 +243,12 @@ where
if restarting {
*last_start_time.lock().unwrap() = Instant::now();
} else {
- let last_start_time_clone = {
- last_start_time.lock().unwrap().clone()
- };
- let current_cumulative_time_clone = {
- cumulative_time.lock().unwrap().clone()
- };
- let new_cumulative_time = current_cumulative_time_clone + last_start_time_clone.elapsed();
+ let last_start_time_clone =
+ { last_start_time.lock().unwrap().clone() };
+ let current_cumulative_time_clone =
+ { cumulative_time.lock().unwrap().clone() };
+ let new_cumulative_time = current_cumulative_time_clone
+ + last_start_time_clone.elapsed();
*cumulative_time.lock().unwrap() = new_cumulative_time;
}