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

feat(toml)!: Update generator by using toml_edit #470

Merged
merged 2 commits into from
Jan 19, 2023
Merged

Conversation

epage
Copy link
Member

@epage epage commented Jan 19, 2023

This is the other main half of #340. Still have deprecations and tests left

Note that strings are rendered differently, see #287

By extension this also finishes up #396.

BREAKING CHANGES

  • impl Display for toml::Value now renders as values, not documents, see instead Table
  • toml::ser::Serializer only serializes documents, instead see toml::ser::ValueSerializer
  • toml::ser::tables_last is removed, no longer needed
  • toml::ser::to_vec is removed to mirror the loss of from_slice
  • atm toml::ser::to_string_pretty just causes larger arrays to be indented
  • toml::ser::Error is now opaque
  • toml::ser::Serializer::pretty_string was removed
  • toml::ser::Serializer::pretty_string_literal was removed
  • toml::ser::Serializer::pretty_array was removed
  • toml::ser::Serializer::pretty_array_indent was removed
  • toml::ser::Serializer::pretty_array_trailing_comma was removed
  • toml::ser::Serializer is now used used by value, rather than &mut

Fixes #396

This is the other main half of toml-rs#340.  Still have deprecations and tests left

Note that strings are rendered differently, see toml-rs#287

By extension this also finishes up toml-rs#396.

BREAKING CHANGES
- `impl Display for toml::Value` now renders as values, not documents, see instead `Table`
- `toml::ser::Serializer` only serializes documents, instead see `toml::ser::ValueSerializer`
- `toml::ser::tables_last` is removed, no longer needed
- `toml::ser::to_vec` is removed to mirror the loss of `from_slice`
- atm `toml::ser::to_string_pretty` just causes larger arrays to be indented
- `toml::ser::Error` is now opaque
- `toml::ser::Serializer::pretty_string` was removed
- `toml::ser::Serializer::pretty_string_literal` was removed
- `toml::ser::Serializer::pretty_array` was removed
- `toml::ser::Serializer::pretty_array_indent` was removed
- `toml::ser::Serializer::pretty_array_trailing_comma` was removed
- `toml::ser::Serializer` is now used used by value, rather than `&mut`

Fixes toml-rs#396
@epage epage mentioned this pull request Jan 19, 2023
4 tasks
@epage epage merged commit 200ded7 into toml-rs:main Jan 19, 2023
@epage epage deleted the merge-ser branch January 19, 2023 18:42
epage added a commit to epage/toml_edit that referenced this pull request Jan 19, 2023
With toml-rs#470, we more reliably generate valid output.

Fixes toml-rs#387
epage added a commit to epage/toml_edit that referenced this pull request Jan 19, 2023
With toml-rs#470, we've changed out generator so we avoid ValueAfterTable
errors.

Fixes toml-rs#356
epage added a commit to epage/toml_edit that referenced this pull request Jan 19, 2023
With toml-rs#470, we changed our generator which can handle more cases

Fixes toml-rs#403
@danieleades
Copy link

what should be used instead of toml::to_vec?

@epage
Copy link
Member Author

epage commented Feb 8, 2023

toml::to_string(&data).into_bytes()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More Error(UnsupportedType) Feedback
2 participants