Skip to content

Commit

Permalink
Avoid creating dummy status code when checking if status code is excl…
Browse files Browse the repository at this point in the history
…uded
  • Loading branch information
mre authored and dmathieu committed Jun 17, 2024
1 parent de8ad09 commit 351e0bd
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lychee-bin/src/commands/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,15 @@ async fn handle(
}

fn ignore_cache(uri: &Uri, status: &Status, cache_exclude_status: &HashSet<u16>) -> bool {
let status_code = match status.code() {
None => 0,
Some(code) => code.as_u16(),
};
let status_code_excluded = status
.code()
.map_or(false, |code| cache_exclude_status.contains(&code.as_u16()));

uri.is_file()
|| status.is_excluded()
|| status.is_unsupported()
|| status.is_unknown()
|| cache_exclude_status.contains(&status_code)
|| status_code_excluded
}

fn show_progress(
Expand Down

0 comments on commit 351e0bd

Please sign in to comment.