Skip to content

Commit

Permalink
Merge pull request #393 from epage/compat
Browse files Browse the repository at this point in the history
fix(toml): Deprecate compat hacks
  • Loading branch information
epage committed Dec 14, 2022
2 parents 99332f7 + 8ad0d37 commit 266fa47
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
5 changes: 5 additions & 0 deletions crates/toml/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ The format is based on [Keep a Changelog].
<!-- next-header -->
## [Unreleased] - ReleaseDate

### Compatibility

- Deprecated `Deserializer::set_require_newline_after_table`
- Deprecated `Deserializer::set_allow_duplicate_after_longer_table`

## [0.5.10] - 2022-12-14

## [0.5.9]
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 266fa47

Please sign in to comment.