From 57cbf82193bbfe095cd876c33890329894b3e699 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Sat, 4 Feb 2023 13:09:41 +0000 Subject: [PATCH] Bump toml to 0.7 --- Cargo.lock | 47 +++++++++++++++++++++++++++++++++++++++++++++-- Cargo.toml | 2 +- src/config.rs | 4 ++-- 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a0b2027..691b6ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -902,6 +902,15 @@ dependencies = [ ] [[package]] +name = "nom8" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8" +dependencies = [ + "memchr", +] + +[[package]] name = "nu-ansi-term" version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1304,6 +1313,15 @@ dependencies = [ ] [[package]] +name = "serde_spanned" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" +dependencies = [ + "serde", +] + +[[package]] name = "sha2" version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1664,11 +1682,36 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.10" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f" +checksum = "772c1426ab886e7362aedf4abc9c0d1348a979517efedfc25862944d10137af0" dependencies = [ "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90a238ee2e6ede22fb95350acc78e21dc40da00bb66c0334bde83de4ed89424e" +dependencies = [ + "indexmap", + "nom8", + "serde", + "serde_spanned", + "toml_datetime", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 3ca9e57..5035727 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ serde-humantime = "0.1" sqlx = { version = "0.6", features = ["runtime-actix-rustls", "sqlite", "any"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] } -toml = "0.5" +toml = "0.7" tokio = { version = "1.24", features = ["full"] } tokio-stream = { version = "0.1", features = ["net"] } tokio-util = { version = "0.7", features = ["codec"] } diff --git a/src/config.rs b/src/config.rs index 48d4472..27a1136 100644 --- a/src/config.rs +++ b/src/config.rs @@ -57,8 +57,8 @@ impl FromStr for Config { type Err = std::io::Error; fn from_str(path: &str) -> Result { - let contents = std::fs::read(path)?; - toml::from_slice(&contents) + let contents = std::fs::read_to_string(path)?; + toml::from_str(&contents) .map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidData, e)) } } -- libgit2 1.7.2