mirror of
https://github.com/Hopiu/lychee.git
synced 2026-04-05 05:51:00 +00:00
Fix parsing errors with config options (#632)
This commit is contained in:
parent
d48a3279a8
commit
9b4dfadffd
6 changed files with 18 additions and 8 deletions
11
Cargo.lock
generated
11
Cargo.lock
generated
|
|
@ -1450,6 +1450,16 @@ version = "2.1.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
|
||||
|
||||
[[package]]
|
||||
name = "humantime-serde"
|
||||
version = "1.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "57a3db5ea5923d99402c94e9feb261dc5ee9b4efa158b0315f788cf549cc200c"
|
||||
dependencies = [
|
||||
"humantime",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hyper"
|
||||
version = "0.14.19"
|
||||
|
|
@ -1745,6 +1755,7 @@ dependencies = [
|
|||
"headers",
|
||||
"http",
|
||||
"humantime",
|
||||
"humantime-serde",
|
||||
"indicatif",
|
||||
"log",
|
||||
"lychee-lib",
|
||||
|
|
|
|||
6
fixtures/configs/smoketest.toml
vendored
6
fixtures/configs/smoketest.toml
vendored
|
|
@ -17,8 +17,7 @@ no_progress = true
|
|||
cache = false
|
||||
|
||||
# Discard all cached requests older than this duration.
|
||||
# Error: invalid type: string "2d", expected struct Duration for key `max_cache_age`
|
||||
# max_cache_age = "2d"
|
||||
max_cache_age = "2d"
|
||||
|
||||
############################# Runtime #############################
|
||||
|
||||
|
|
@ -69,8 +68,7 @@ headers = []
|
|||
remap = [ "https://example.com http://example.invalid" ]
|
||||
|
||||
# Base URL or website root directory to check relative URLs.
|
||||
# Error: invalid type: unit variant, expected newtype variant for key `base`
|
||||
# base = "https://example.com"
|
||||
base = "https://example.com"
|
||||
|
||||
# HTTP basic auth support. This will be the username and password passed to the
|
||||
# authorization HTTP header. See
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ once_cell = "1.12.0"
|
|||
dashmap = { version = "5.3.4", features = ["serde"] }
|
||||
csv = "1.1.6"
|
||||
humantime = "2.1.0"
|
||||
humantime-serde = "1.1.1"
|
||||
secrecy = { version = "0.8.0", features = ["serde"] }
|
||||
supports-color = "1.3.0"
|
||||
log = "0.4.17"
|
||||
|
|
|
|||
|
|
@ -165,6 +165,7 @@ pub(crate) struct Config {
|
|||
default_value = &MAX_CACHE_AGE_STR
|
||||
)]
|
||||
#[serde(default = "max_cache_age")]
|
||||
#[serde(with = "humantime_serde")]
|
||||
pub(crate) max_cache_age: Duration,
|
||||
|
||||
/// Don't perform any link checking.
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ use crate::{ErrorKind, InputSource};
|
|||
/// Both, local and remote targets are supported.
|
||||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
|
||||
#[allow(variant_size_differences)]
|
||||
#[serde(try_from = "&str")]
|
||||
pub enum Base {
|
||||
/// Local file path pointing to root directory
|
||||
Local(PathBuf),
|
||||
|
|
|
|||
|
|
@ -16,8 +16,7 @@ output = "report.md"
|
|||
cache = true
|
||||
|
||||
# Discard all cached requests older than this duration.
|
||||
# Error: invalid type: string "2d", expected struct Duration for key `max_cache_age`
|
||||
# max_cache_age = "2d"
|
||||
max_cache_age = "2d"
|
||||
|
||||
############################# Runtime #############################
|
||||
|
||||
|
|
@ -68,8 +67,7 @@ headers = []
|
|||
remap = [ "https://example.com http://example.invalid" ]
|
||||
|
||||
# Base URL or website root directory to check relative URLs.
|
||||
# Error: invalid type: unit variant, expected newtype variant for key `base`
|
||||
# base = "https://example.com"
|
||||
base = "https://example.com"
|
||||
|
||||
# HTTP basic auth support. This will be the username and password passed to the
|
||||
# authorization HTTP header. See
|
||||
|
|
|
|||
Loading…
Reference in a new issue