Skip to content

Commit

Permalink
Run cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ewen-lbh committed Jan 5, 2025
1 parent 8385de6 commit 07048c8
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 deletions.
4 changes: 3 additions & 1 deletion lychee-bin/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ pub(crate) fn create(cfg: &Config, cookie_jar: Option<&Arc<CookieStoreMutex>>) -
.include_fragments(cfg.include_fragments)
.fallback_extensions(cfg.fallback_extensions.clone())
.recursive_domains(match (cfg.recursive, cfg.recursed_domains.clone()) {
(true, domains) if domains.is_empty() => todo!("please specify --recursed-domains for now"),
(true, domains) if domains.is_empty() => {
todo!("please specify --recursed-domains for now")
}
(true, domains) => domains,
_ => vec![],
})
Expand Down
5 changes: 4 additions & 1 deletion lychee-bin/src/commands/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,10 @@ async fn request_channel_task(
)
.await;

send_resp.send(response).await.expect("Cannot send response");
send_resp
.send(response)
.await
.expect("Cannot send response");
// if let Err(_) = timeout(Duration::from_millis(500), send_resp.send(response)).await {
// println!(
// "Timeout occurred while sending response to queue for {}",
Expand Down
4 changes: 2 additions & 2 deletions lychee-bin/src/formatters/stats/detailed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ mod tests {
let err1 = ResponseBody {
uri: Uri::try_from("https://github.com/mre/idiomatic-rust-doesnt-exist-man").unwrap(),
status: Status::Ok(StatusCode::NOT_FOUND),
subsequent_uris : vec![],
subsequent_uris: vec![],
};

let err2 = ResponseBody {
uri: Uri::try_from("https://github.com/mre/boom").unwrap(),
status: Status::Ok(StatusCode::INTERNAL_SERVER_ERROR),
subsequent_uris : vec![],
subsequent_uris: vec![],
};

let mut error_map: HashMap<InputSource, HashSet<ResponseBody>> = HashMap::new();
Expand Down
2 changes: 1 addition & 1 deletion lychee-bin/src/formatters/stats/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ mod tests {
Uri::try_from("http://127.0.0.1").unwrap(),
Status::Cached(CacheStatus::Error(Some(404))),
InputSource::Stdin,
vec![]
vec![],
);
stats.add(response);
stats
Expand Down
16 changes: 14 additions & 2 deletions lychee-lib/src/types/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,20 @@ impl Response {
#[inline]
#[must_use]
/// Create new response
pub const fn new(uri: Uri, status: Status, source: InputSource, subsequent_uris: Vec<Uri>) -> Self {
Response(source, ResponseBody { uri, status, subsequent_uris })
pub const fn new(
uri: Uri,
status: Status,
source: InputSource,
subsequent_uris: Vec<Uri>,
) -> Self {
Response(
source,
ResponseBody {
uri,
status,
subsequent_uris,
},
)
}

#[inline]
Expand Down

0 comments on commit 07048c8

Please sign in to comment.