Skip to content

Commit 21e67de

Browse files
authored
Merge pull request #41 from hellow554/clippy-lints
apply clippy lints
2 parents ee56fff + 9814591 commit 21e67de

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use xz2::read::XzDecoder;
2525

2626
static SUPPORTED_CHANNELS: &[&str] = &["nightly", "beta", "stable"];
2727

28+
#[allow(clippy::struct_excessive_bools)]
2829
#[derive(StructOpt, Debug)]
2930
#[structopt(set_term_width(0))]
3031
struct Args {
@@ -315,7 +316,7 @@ fn fetch_master_commit_via_git() -> Result<String, Error> {
315316
output
316317
.stdout
317318
.get(..40)
318-
.map_or(false, |h| h.iter().all(|c| c.is_ascii_hexdigit())),
319+
.map_or(false, |h| h.iter().all(u8::is_ascii_hexdigit)),
319320
"git ls-remote does not return a commit"
320321
);
321322

@@ -355,7 +356,7 @@ fn fetch_master_commit_via_http(
355356
if master_commit.len() == 40
356357
&& master_commit
357358
.chars()
358-
.all(|c| '0' <= c && c <= '9' || 'a' <= c && c <= 'f')
359+
.all(|c| matches!(c, '0'..='9' | 'a'..='f'))
359360
{
360361
let out = stdout();
361362
let mut lock = out.lock();
@@ -510,7 +511,7 @@ fn report_warn(warn: &Error) {
510511
for cause in warn.chain().skip(1) {
511512
eprintln!("{} {}", Yellow.bold().paint("caused by:"), cause);
512513
}
513-
eprintln!("");
514+
eprintln!();
514515
}
515516

516517
fn main() {

0 commit comments

Comments
 (0)