Skip to content

Commit 521c6e1

Browse files
committed
thanks clippy
1 parent 88d3399 commit 521c6e1

File tree

12 files changed

+20
-38
lines changed

12 files changed

+20
-38
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ include = ["src/**/*", "README.md", "LICENSE.md", "CHANGELOG.md"]
88
license = "MIT"
99
repository = "https://github.com/Byron/prodash"
1010
readme = "README.md"
11+
rust-version = "1.74"
1112

1213
[lib]
1314
doctest = true

examples/dashboard.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
compile_error!(
55
"The `render-tui` feature must be set, along with either `render-tui-crossterm` or `render-tui-termion`"
66
);
7-
#[cfg(not(any(feature = "render-tui-crossterm", feature = "render-tui-termion")))]
8-
compile_error!(
9-
"Please set either the 'render-tui-crossterm' or 'render-tui-termion' feature whne using the 'render-tui'"
10-
);
7+
#[cfg(not(any(feature = "render-tui-crossterm")))]
8+
compile_error!("Please set the 'render-tui-crossterm' feature when using the 'render-tui'");
119

1210
fn main() -> Result {
1311
env_logger::init();

examples/shared/args.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,9 @@ pub struct Options {
6363
#[argh(option)]
6464
pub line_end: Option<prodash::progress::key::Level>,
6565

66-
/// if set (default: false), we will stop running the TUI once there the list of drawable progress items is empty.
67-
#[argh(switch)]
68-
pub stop_if_empty_progress: bool,
69-
7066
/// set the renderer to use, defaults to "tui", and furthermore allows "line" and "log".
7167
///
7268
/// If set ot "log", there will only be logging. Set 'RUST_LOG=info' before running the program to see them.
7369
#[argh(option, short = 'R')]
7470
pub renderer: Option<String>,
75-
76-
/// has not effect - use the NO_COLOR environment variable instead.
77-
#[argh(switch)]
78-
pub no_line_color: bool,
7971
}

examples/units.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
#![deny(unsafe_code)]
22

33
#[cfg(not(feature = "render-tui"))]
4-
compile_error!(
5-
"The `render-tui` feature must be set, along with either `render-tui-crossterm` or `render-tui-termion`"
6-
);
7-
#[cfg(not(any(feature = "render-tui-crossterm", feature = "render-tui-termion")))]
8-
compile_error!(
9-
"Please set either the 'render-tui-crossterm' or 'render-tui-termion' feature whne using the 'render-tui'"
10-
);
4+
compile_error!("The `render-tui` feature must be set, along with the `render-tui-crossterm`");
5+
#[cfg(not(any(feature = "render-tui-crossterm")))]
6+
compile_error!("Please set the 'render-tui-crossterm' feature when using the 'render-tui'");
117

128
use std::{error::Error, sync::Arc};
139

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![deny(unsafe_code, missing_docs)]
2+
#![allow(clippy::empty_docs)]
23

34
/*!
45
Prodash is a dashboard for displaying the progress of concurrent application.

src/render/line/draw.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ pub fn all(out: &mut impl io::Write, show_progress: bool, state: &mut State, con
149149
let level_range = config
150150
.level_filter
151151
.clone()
152-
.unwrap_or(RangeInclusive::new(0, progress::key::Level::max_value()));
152+
.unwrap_or(RangeInclusive::new(0, progress::key::Level::MAX));
153153
let lines_to_be_drawn = state
154154
.tree
155155
.iter()
@@ -253,7 +253,7 @@ fn draw_progress_bar(p: &Value, style: Style, mut blocks_available: u16, colored
253253
const CHARS: [char; 6] = ['=', '=', '=', ' ', ' ', ' '];
254254
buf.push(
255255
styled_brush.paint(
256-
(p.step.load(Ordering::SeqCst)..std::usize::MAX)
256+
(p.step.load(Ordering::SeqCst)..usize::MAX)
257257
.take(blocks_available as usize)
258258
.map(|idx| CHARS[idx % CHARS.len()])
259259
.rev()

src/render/line/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
#[cfg(all(
2-
feature = "render-line",
3-
not(any(feature = "render-line-crossterm", feature = "render-line-termion"))
4-
))]
5-
compile_error!("Please choose either one of these features: 'render-line-crossterm' or 'render-line-termion'");
1+
#[cfg(all(feature = "render-line", not(any(feature = "render-line-crossterm"))))]
2+
compile_error!("Please use the 'render-line-crossterm' feature");
63

74
mod draw;
85
mod engine;

src/render/tui/draw/progress.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ pub(crate) fn headline(
140140

141141
struct ProgressFormat<'a>(&'a Option<Value>, u16, Option<unit::display::Throughput>);
142142

143-
impl<'a> fmt::Display for ProgressFormat<'a> {
143+
impl fmt::Display for ProgressFormat<'_> {
144144
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
145145
match self.0 {
146146
Some(p) => match p.unit.as_ref() {

src/render/tui/engine.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,8 @@ pub(crate) enum InterruptDrawInfo {
8989
Deferred(bool),
9090
}
9191

92-
#[cfg(not(any(feature = "render-tui-crossterm", feature = "render-tui-termion")))]
93-
compile_error!(
94-
"Please set either the 'render-tui-crossterm' or 'render-tui-termion' feature whne using the 'render-tui'"
95-
);
92+
#[cfg(not(any(feature = "render-tui-crossterm")))]
93+
compile_error!("Please set the 'render-tui-crossterm' feature when using the 'render-tui'");
9694

9795
use crosstermion::crossterm::event::{KeyCode, KeyEventKind, KeyModifiers};
9896
use crosstermion::{

src/time.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ mod utc {
3030
use std::time::SystemTime;
3131

3232
use super::DATE_TIME_HMS;
33-
const DATE_TIME_YMD: usize = "2020-02-13T".len();
3433

3534
/// Return a string representing the current date and time as UTC.
3635
///

0 commit comments

Comments
 (0)