mirror of
https://github.com/Hopiu/lychee.git
synced 2026-03-29 10:50:24 +00:00
Bump toml from 0.5.11 to 0.7.0 (#933)
* Bump toml from 0.5.11 to 0.7.0 Bumps [toml](https://github.com/toml-rs/toml) from 0.5.11 to 0.7.0. - [Release notes](https://github.com/toml-rs/toml/releases) - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.5.11...toml-v0.7.0) --- updated-dependencies: - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Introduce new let...else syntax * Update config file loading for latest toml crate version --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Matthias <matthias-endler@gmx.net> Co-authored-by: Matthias Endler <matthias@endler.dev>
This commit is contained in:
parent
0a2cd324d5
commit
d8e4940dbe
3 changed files with 48 additions and 5 deletions
47
Cargo.lock
generated
47
Cargo.lock
generated
|
|
@ -2208,6 +2208,15 @@ dependencies = [
|
|||
"minimal-lexical",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nom8"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "normalize-line-endings"
|
||||
version = "0.3.0"
|
||||
|
|
@ -3077,6 +3086,15 @@ dependencies = [
|
|||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_spanned"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2c68e921cef53841b8925c2abadd27c9b891d9613bdc43d6b823062866df38e8"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_urlencoded"
|
||||
version = "0.7.1"
|
||||
|
|
@ -3510,11 +3528,36 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "toml"
|
||||
version = "0.5.11"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"
|
||||
checksum = "2f560bc7fb3eb31f5eee1340c68a2160cad39605b7b9c9ec32045ddbdee13b85"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_spanned",
|
||||
"toml_datetime",
|
||||
"toml_edit",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml_datetime"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "886f31a9b85b6182cabd4d8b07df3b451afcc216563748201490940d2a28ed36"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml_edit"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "233d8716cdc5d20ec88a18a839edaf545edc71efa4a5ff700ef4a102c26cd8fa"
|
||||
dependencies = [
|
||||
"indexmap",
|
||||
"nom8",
|
||||
"serde",
|
||||
"serde_spanned",
|
||||
"toml_datetime",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ ring = "0.16.20"
|
|||
serde = { version = "1.0.152", features = ["derive"] }
|
||||
serde_json = "1.0.91"
|
||||
tabled = "0.10.0"
|
||||
toml = "0.7.0"
|
||||
tokio = { version = "1.25.0", features = ["full"] }
|
||||
toml = "0.5.11"
|
||||
futures = "0.3.25"
|
||||
tokio-stream = "0.1.11"
|
||||
once_cell = "1.17.0"
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ impl Config {
|
|||
/// Load configuration from a file
|
||||
pub(crate) fn load_from_file(path: &str) -> Result<Option<Config>> {
|
||||
// Read configuration file
|
||||
let result = fs::read(path);
|
||||
let result = fs::read_to_string(path);
|
||||
|
||||
// Ignore a file-not-found error
|
||||
let contents = match result {
|
||||
|
|
@ -355,7 +355,7 @@ impl Config {
|
|||
}
|
||||
};
|
||||
|
||||
Ok(Some(toml::from_slice(&contents)?))
|
||||
Ok(Some(toml::from_str(&contents)?))
|
||||
}
|
||||
|
||||
/// Merge the configuration from TOML into the CLI configuration
|
||||
|
|
|
|||
Loading…
Reference in a new issue