Skip to content

Commit

Permalink
Fix warnings from clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ewen-lbh committed Jan 5, 2025
1 parent 07048c8 commit ca13561
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions lychee-bin/src/commands/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ async fn response_receive_task(
formatter: Box<dyn ResponseFormatter>,
mut stats: ResponseStats,
) -> Result<(Option<ProgressBar>, ResponseStats)> {
let mut i = 0;
// let mut i = 0;
while let Some(response) = recv_resp.recv().await {
i = i + 1;
// i += 1;
// println!(
// "starting response #{} out of {}",
// i,
Expand All @@ -219,7 +219,7 @@ async fn response_receive_task(
&verbose,
)?;

for uri in response.body().subsequent_uris.iter() {
for uri in &response.body().subsequent_uris {
let request = Request::try_from(uri.clone())?;
req_send
.send(Ok(request))
Expand All @@ -235,7 +235,7 @@ async fn response_receive_task(
remaining_requests.fetch_sub(1, Ordering::Relaxed);
let remaining_now = remaining_requests.load(Ordering::Relaxed);
// println!("remaining requests: {}", remaining_now);
if remaining_now <= 0 {
if remaining_now == 0 {
break;
}

Expand Down
8 changes: 4 additions & 4 deletions lychee-lib/src/checker/website.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl WebsiteChecker {
.collect();
// println!("recursing {}: found {:?}", response_url, links.clone());

return (status, links);
(status, links)
}
}
}
Expand Down Expand Up @@ -174,13 +174,13 @@ impl WebsiteChecker {
.check_website_inner(&uri.to_https()?, &default_chain)
.await;

if !status.is_success() {
if status.is_success() {
Ok((Status::Ok(code), new_uris))
} else {
Ok((
Status::Error(ErrorKind::InsecureURL(uri.to_https()?)),
vec![],
))
} else {
Ok((Status::Ok(code), new_uris))
}
}
s => Ok(s),
Expand Down
2 changes: 1 addition & 1 deletion lychee-lib/src/types/basic_auth/credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub struct BasicAuthCredentials {

impl BasicAuthCredentials {
/// Create a new [`BasicAuthCredentials`] instance.
pub fn new(username: String, password: String) -> Self {
#[must_use] pub const fn new(username: String, password: String) -> Self {
Self {
username,
password,
Expand Down
2 changes: 1 addition & 1 deletion lychee-lib/src/types/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ impl Input {
}

/// Construct a new `Input` source from a raw string that represents the contents of the input (website, file, etc.)
pub fn raw_string(s: &str, file_type_hint: Option<FileType>) -> Self {
#[must_use] pub fn raw_string(s: &str, file_type_hint: Option<FileType>) -> Self {
Self {
source: InputSource::String(s.to_owned()),
file_type_hint,
Expand Down

0 comments on commit ca13561

Please sign in to comment.