Skip to content

Commit

Permalink
fix(toml): Deprecate compat hacks
Browse files Browse the repository at this point in the history
`toml_edit` won't be able to support these.  For example,
cargo moved away from these in rust-lang/cargo#9932 to prepare for
rust-lang/cargo#10086
  • Loading branch information
epage committed Sep 23, 2022
1 parent c488802 commit 20f1487
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
6 changes: 6 additions & 0 deletions crates/toml/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ The format is based on [Keep a Changelog].
<!-- next-header -->
## [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:
Expand Down
16 changes: 4 additions & 12 deletions crates/toml/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 20f1487

Please sign in to comment.