Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(toml): Deprecate compat hacks #393

Merged
merged 1 commit into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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