lychee/lychee-bin/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
..
commands chore!: improve client and remap modules (#913) 2023-01-16 19:14:09 +01:00
formatters Extend response stats in verbose mode (#882) 2022-12-20 10:43:01 +01:00
cache.rs Add documentation 2022-06-21 10:03:31 +02:00
client.rs Bump clap from 3.2.23 to 4.0.22 (#813) 2022-11-13 21:10:32 +01:00
color.rs Add support for different output formats (compact, detailed, markdown) (#375) 2021-11-18 00:44:48 +01:00
main.rs Less verbose cache age formatting (#849) 2022-11-29 00:39:49 +01:00
options.rs Fix verbosity serialization (#853) 2022-11-29 12:59:32 +01:00
parse.rs Allow overriding accepted status codes for cached URIs (#843) 2022-11-28 12:23:07 +01:00
progress.rs Refactor check function (#860) 2022-12-12 01:05:47 +01:00
stats.rs Extend response stats in verbose mode (#882) 2022-12-20 10:43:01 +01:00
time.rs Add caching functionality (v2) (#443) 2022-01-14 15:25:51 +01:00
verbosity.rs Add different verbosity levels (#824) 2022-11-28 23:25:33 +01:00