From 6ac9b138baed9c7774bd20ccb268ccd36d9f8d78 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 23 Sep 2022 12:54:28 -0500 Subject: [PATCH] fix(toml): Deprecate compat hacks `toml_edit` won't be able to support these. For example, cargo moved away from these in https://github.com/rust-lang/cargo/pull/9932 to prepare for https://github.com/rust-lang/cargo/pull/10086 This is prep for #340 --- crates/toml/CHANGELOG.md | 6 ++++++ crates/toml/src/de.rs | 16 ++++------------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/crates/toml/CHANGELOG.md b/crates/toml/CHANGELOG.md index b3dde7e4..1fe6f6f5 100644 --- a/crates/toml/CHANGELOG.md +++ b/crates/toml/CHANGELOG.md @@ -7,6 +7,12 @@ The format is based on [Keep a Changelog]. ## [Unreleased] - ReleaseDate +### Compatibility + +- Bumped MSRV to 1.60.0 +- Deprecated `Deserializer::set_require_newline_after_table` +- Deprecated `Deserializer::set_allow_duplicate_after_longer_table` + ## [0.5.9] Changes: diff --git a/crates/toml/src/de.rs b/crates/toml/src/de.rs index 5dbe0aba..e2f56378 100644 --- a/crates/toml/src/de.rs +++ b/crates/toml/src/de.rs @@ -1279,22 +1279,14 @@ impl<'a> Deserializer<'a> { Ok(()) } - /// Historical versions of toml-rs accidentally allowed a newline after a - /// table definition, but the TOML spec requires a newline after a table - /// definition header. - /// - /// This option can be set to `false` (the default is `true`) to emulate - /// this behavior for backwards compatibility with older toml-rs versions. + #[doc(hidden)] + #[deprecated(since = "0.5.10")] pub fn set_require_newline_after_table(&mut self, require: bool) { self.require_newline_after_table = require; } - /// Historical versions of toml-rs accidentally allowed a duplicate table - /// header after a longer table header was previously defined. This is - /// invalid according to the TOML spec, however. - /// - /// This option can be set to `true` (the default is `false`) to emulate - /// this behavior for backwards compatibility with older toml-rs versions. + #[doc(hidden)] + #[deprecated(since = "0.5.10")] pub fn set_allow_duplicate_after_longer_table(&mut self, allow: bool) { self.allow_duplciate_after_longer_table = allow; }