Skip to content

Commit e803106

Browse files
committed
Address lints yet again lol
1 parent cd82445 commit e803106

File tree

11 files changed

+33
-211
lines changed

11 files changed

+33
-211
lines changed

Cargo.lock

Lines changed: 2 additions & 198 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lychee-bin/src/commands/check.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,7 @@ async fn receive_responses(
232232

233233
if recurse
234234
&& max_recursion_depth
235-
.map(|limit| response.1.recursion_level < limit)
236-
.unwrap_or(true)
235+
.map_or(true, |limit| response.1.recursion_level < limit)
237236
{
238237
println!(
239238
"recursing: {} has depth {} < {}",

lychee-bin/src/formatters/response/task.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ mod task_tests {
2020
ResponseBody {
2121
uri: Uri::try_from(uri).unwrap(),
2222
status,
23+
recursion_level: 0,
24+
subsequent_uris: vec![],
2325
}
2426
}
2527

lychee-bin/src/formatters/stats/compact.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ mod tests {
177177
cached: 0,
178178
success_map,
179179
excluded_map: HashMap::default(),
180+
other_map: HashMap::default(),
180181
detailed_stats: false,
181182
};
182183

lychee-bin/src/formatters/stats/detailed.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ mod tests {
145145
success_map: HashMap::default(),
146146
error_map,
147147
excluded_map: HashMap::default(),
148+
other_map: HashMap::default(),
148149
detailed_stats: true,
149150
};
150151

lychee-bin/src/formatters/stats/markdown.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ mod tests {
223223
Status::Cached(CacheStatus::Error(Some(404))),
224224
InputSource::Stdin,
225225
vec![],
226-
0,
226+
0,
227227
);
228228
stats.add(response);
229229
stats

lychee-bin/src/formatters/stats/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ mod tests {
6565
fn make_test_response(url_str: &str, source: InputSource) -> Response {
6666
let uri = Uri::from(make_test_url(url_str));
6767

68-
Response::new(uri, Status::Error(ErrorKind::InvalidUrlHost), source)
68+
Response::new(uri, Status::Error(ErrorKind::InvalidUrlHost), source, vec![], 0)
6969
}
7070

7171
#[test]

lychee-bin/src/main.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,6 @@ fn load_cache(cfg: &Config) -> Option<Cache> {
251251
fn run_main() -> Result<i32> {
252252
use std::process::exit;
253253

254-
console_subscriber::init();
255-
256254
let opts = match load_config() {
257255
Ok(opts) => opts,
258256
Err(e) => {

lychee-bin/src/stats.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,10 @@ impl ResponseStats {
9090

9191
/// Check if a response was already checked and added to the stats
9292
pub(crate) fn was_checked(&self, response: &Response) -> bool {
93-
vec![
94-
self.success_map.get(response.source()),
93+
[self.success_map.get(response.source()),
9594
self.error_map.get(response.source()),
9695
self.excluded_map.get(response.source()),
97-
self.other_map.get(response.source()),
98-
]
96+
self.other_map.get(response.source())]
9997
.iter()
10098
.any(|&x| x.is_some_and(|x| x.contains(response.body())))
10199
}

lychee-lib/src/client.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,13 @@ impl Client {
477477
self.remap(uri)?;
478478

479479
if self.is_excluded(uri) {
480-
return Ok(Response::new(uri.clone(), Status::Excluded, source, vec![], recursion_level));
480+
return Ok(Response::new(
481+
uri.clone(),
482+
Status::Excluded,
483+
source,
484+
vec![],
485+
recursion_level,
486+
));
481487
}
482488

483489
let mut subsequent_uris: Vec<Uri> = vec![];
@@ -494,7 +500,13 @@ impl Client {
494500
}
495501
};
496502

497-
Ok(Response::new(uri.clone(), status, source, subsequent_uris, recursion_level))
503+
Ok(Response::new(
504+
uri.clone(),
505+
status,
506+
source,
507+
subsequent_uris,
508+
recursion_level,
509+
))
498510
}
499511

500512
/// Check a single file using the file checker.

0 commit comments

Comments
 (0)