Skip to content

Commit

Permalink
Fix clippy errors (#1423)
Browse files Browse the repository at this point in the history
* Enclose Markdown links in brackets

The current clippy version (v0.1.78) says "you should put bare URLs
between `<`/`>` or make a proper Markdown link" and refers to
https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

* Enclose documentation item in backticks

Clippy v0.1.78 complains about the IPv6 network mask, insisting that it
is missing backticks. So backticks it gets.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

* Avoid error claiming `Add(usize)` is dead code

Clippy v0.1.78 identifies this as dead code. However, further down in
the same file, there is clearly a user:

  impl Handler<Result, Result> for Add {

This might be yet another incarnation of
rust-lang/rust#56750

Let's just mark it as intentionally dead-code, even if this is untrue,
to make clippy happy again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

---------

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed May 13, 2024
1 parent 0a54079 commit 975901d
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ Options:
[default: get]
-b, --base <BASE>
Base URL or website root directory to check relative URLs e.g. https://example.com or `/path/to/public`
Base URL or website root directory to check relative URLs e.g. <https://example.com> or `/path/to/public`
--basic-auth <BASIC_AUTH>
Basic authentication support. E.g. `http://example.com username:password`
Expand Down
2 changes: 1 addition & 1 deletion lychee-bin/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ separated list of accepted status codes. This example will accept 200, 201,
pub(crate) method: String,

/// Base URL or website root directory to check relative URLs
/// e.g. https://example.com or `/path/to/public`
/// e.g. <https://example.com> or `/path/to/public`
#[arg(short, long, value_parser= parse_base)]
#[serde(default)]
pub(crate) base: Option<Base>,
Expand Down
1 change: 1 addition & 0 deletions lychee-lib/src/chain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ mod test {
};
use async_trait::async_trait;

#[allow(dead_code)] // work-around
#[derive(Debug)]
struct Add(usize);

Expand Down
2 changes: 1 addition & 1 deletion lychee-lib/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ pub struct ClientBuilder {

/// Cookie store used for requests.
///
/// See https://docs.rs/reqwest/latest/reqwest/struct.ClientBuilder.html#method.cookie_store
/// See <https://docs.rs/reqwest/latest/reqwest/struct.ClientBuilder.html#method.cookie_store>
cookie_jar: Option<Arc<CookieStoreMutex>>,

/// Enable the checking of fragments in links.
Expand Down
2 changes: 1 addition & 1 deletion lychee-lib/src/filter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub struct Filter {
/// Example: 169.254.0.0
pub exclude_link_local_ips: bool,
/// For IPv4: 127.0.0.1/8
/// For IPv6: ::1/128
/// For IPv6: `::1/128`
pub exclude_loopback_ips: bool,
/// Example: octocat@github.com
pub include_mail: bool,
Expand Down
2 changes: 1 addition & 1 deletion lychee-lib/src/types/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub enum Status {
Excluded,
/// The request type is currently not supported,
/// for example when the URL scheme is `slack://`.
/// See https://github.com/lycheeverse/lychee/issues/199
/// See <https://github.com/lycheeverse/lychee/issues/199>
Unsupported(ErrorKind),
/// Cached request status from previous run
Cached(CacheStatus),
Expand Down

0 comments on commit 975901d

Please sign in to comment.