lychee/lychee-lib/src
Lucius Hu e2406089ad
chore!: improve client and remap modules (#913)
`lychee_lib::client`:

- Improved documentation.
- Added an log message in `ClientBuilder::client()` when provied user-agent
  overrides the one defined in provied custom header.
- Removed unnecessary error handling in `Client::check()` when setting HTTPS
  scheme because all failure cases should occur when checking this URL the first
  time already.
- Removed unnecessary error handling in `Client::remap()` since
  `lychee-lib::remap::Remaps::remap()` doesn't returns a `Result` anymore.
- Fixed potential integer overflow in `Client::check_website()` when the wait
  time between retries doubles, by using `std::time::Duration::saturating_mul`
  instead.
- Renamed `invalid()` to `validate_url()`.

`lychee_lib::remap`:

- Improved documentation, in particular, clarified (in the comment) that it's
  URLs not URIs being remapped.
- Changed `Remaps::remap()` so it takes `&mut Url` instead of `Uri` as its
  argument, and doesn't return a `Result` as a result.
    - Using `Url` instead of `Uri` because it aligns with the concept of
      remapping locations rather than identifiers.
    - Mutating the URL directly instead of returning a new one for it's more
      straightforward.
    - There is no error handling because we don't convert from URL to URI
      anymore. Furthermore, this always succeed in the first place so we never
      needed error handling.
- Added implementation of `IntoIterator` for `&'a Remaps` and convenience method
  of `Remaps::iter`. (Their mutable or moving counterparts are deliberately
  avoided because we don't want library users to modify all consume the
  remapping rules after its instantiation.)

`lychee_lib::error`:

- Renamed `ErrorKind::InvalidUriRemap` to `InvalidUrlRemap` and improved
  its error message.

Changes to other modules are minor and only serves to accompany aforementioned
changes.
2023-01-16 19:14:09 +01:00
..
extract Remove address from verbatim elements (#901) 2023-01-05 14:55:53 +01:00
filter Don't check example mail addresses by default (#815) 2022-11-08 23:46:32 +01:00
helpers Fix parsing error of email addresses with query params (#809) 2022-11-05 23:40:33 +01:00
quirks Properly handle youtu.be shortlinks (#908) 2023-01-06 18:25:09 +01:00
types chore!: improve client and remap modules (#913) 2023-01-16 19:14:09 +01:00
client.rs chore!: improve client and remap modules (#913) 2023-01-16 19:14:09 +01:00
collector.rs Fix Rust 1.66 clippy lints (#879) 2022-12-19 14:28:10 +01:00
lib.rs chore!: improve client and remap modules (#913) 2023-01-16 19:14:09 +01:00
remap.rs chore!: improve client and remap modules (#913) 2023-01-16 19:14:09 +01:00
test_utils.rs Harden URL detection and extend verbatim elements (#899) 2023-01-04 00:38:19 +01:00