The format is based on Keep a Changelog.
- Prevent stackoverflows with a recusion limit. Disable with
unbounded
feature flag
The parser was re-implemented and this was considered high-risk enough to treat as a breaking release
- Significantly faster to build
- Faster to parse, especially on files with few fields per table
- Error messages are different, some are better, some are worse
Datetime
's FromStr::Err
changed from toml_edit::Error
to toml_edit::DatetimeParseError
Datetime
no longer implements TryFrom
Time
no longer implements FromStr
, TryFrom
, Serialize
, or Deserialize
Date
no longer implements FromStr
, TryFrom
, Serialize
, or Deserialize
- Remove leading newlines in the document with default table decor
- Allow enum variants as table keys
Tables
- Added
OccupiedEntry::key_mut
and InlineOccupiedEntry::key_mut
- Added
TableLike::entry
and TableLike::entry
- Added
get_key_value()
and get_key_value_mut()
to TableLike
, Table
, and InlineTable
- make performance-specific dependencies optional with the
perf
feature (default)
- Upgrade to faster
kstring
- Have
toml_edit::easy::to_string_pretty
render empty tables
toml_edit::value
now uses default decor
- Allowing clearing table-likes
- Programmatically expose line and column for some errors
- Slight performance improvement with comments
iter
, get
, and contains_key
functions were made consistent across Table
and InlineTable
, ignoring Item::None
.
- Reduce places users need to handle both
None
and Item::None
, making the APIs more consistent across the board
- Remove a quote around a non-literal value in an error
- Errors now only quote literals
- Fix
Table::set_position
documentation so its clear it always applies
to_string_pretty
now hides empty tables
- Cleaned up several error messages
toml_edit::ser::to_string_pretty
is now pretty
- Added
Table::sort_values_by
and InlineTable::sort_values_by
- Clarified error message when accidentally using bare words for values
- Serde trait bounds switched from
serde::Deserialize<'static>
to serde::de::DeserializeOwned
- Serde trait bounds switched from
serde::Deserialize<'static>
to serde::de::DeserializeOwned
- Use
Key::parse
to parse a string of dotted keys into a Vec<Key>
Key::from_str
now strictly parses TOML syntax
Key::from_str
now strictly parses TOML syntax
- Allow trailing whitespace after dates
- Truncate overflowing fractional seconds rather than error (we will still roundtrip the original time)
TableLike::fmt
now resets the decor to default (None
) rather than assigning the default decor
- Converting between table types clears formatting
Key
now derefs to the key's value
- Allow modifying key formatting with
iter_mut()
- New
visit
and visit_mut
APIs
Value::try_from
and Value::try_into
to work with all types
- Don't fail on UTF-8 BOM
- Ensure there is a trailing space for default-formatted inline tables
- Converting between table types clears formatting
Array::fmt
removes trailing comma and whitespace
- Allow indexing on
InlineTable
- serde support for newtypes
- Don't error on
easy::Value::to_string
- Some types in
toml_edit::ser
got shuffled around.
- Added
toml_edit::ser::to_item
for converting any serializable state to a toml_edit::Item
- Added
toml_edit::InlineTable::into_table
- Added
toml_edit::Document
now has a From<Table>
impl.
toml_edit::Item::into_table
now includes InlineTable
- Disallow the direct creation of
toml_edit::ser::Serializer
so we can change it in the future.
- Decouple serde support from
easy
feature
- Make core types impl
Deserializer
, making it easier to use them
- Make core types impl
Display
so its easier to print errors to users
Document::root
is now private
- The
Index
implementation for Item
now panics when the index is not found
- Use
Item::get
and Item::get_mut
instead
Document
now derefs to Table
for easier access
Item
now has get
/ get_mut
like easy::Value
- Clarified role of
toml_edit::easy
- Add
TableLike::set_dotted
so you can make a table dotted, independent of its type
- Allow dotted inline-tables in standard tables
toml_edit::TableLike
is now sealed, disallowing others to implement it
toml_edit |
cargo init Cargo.toml |
Cargo's Cargo.toml |
HEAD |
4.0 us |
149 us |
toml_edit::easy |
cargo init Cargo.toml |
Cargo's Cargo.toml |
v0.4.0 |
16.9 us |
602 us |
HEAD |
5.0 us |
179 us |
toml |
cargo init Cargo.toml |
Cargo's Cargo.toml |
v0.5.8 |
4.7 us |
121 us |
- Removed ambiguity between
String
and Datetime
when deserializing
- Hand implemented
Deserialize
for toml_edit::easy::Value
to dispatch on type, rather than trying every variant.
Datetime
is no longer a string in serde
s data model but a proprietary type.
- Changed some strings callers generally don't interact with (e.g.
Into<String>
) to an opaque type, allowing us to change how we allocate most
strings without requiring breaking changes in the future.
- This impacts
Key
, Repr
, and Decor
- This does not impact
Value
, assuming people want a familiar type over performance
- Support trailing quotes in strings
toml_edit |
cargo init Cargo.toml |
Cargo's Cargo.toml |
v0.3.1 |
8.7 us |
271 us |
HEAD |
4.1 us |
150 us |
toml_edit::easy |
cargo init Cargo.toml |
Cargo's Cargo.toml |
v0.3.1 |
21.2 us |
661 us |
HEAD |
18.6 us |
630 us |
toml |
cargo init Cargo.toml |
Cargo's Cargo.toml |
v0.5.8 |
4.8 us |
125 us |
Changes include:
- Batch create strings
- Small-string optimization
- Removed superfluous allocations
- Switched from recursion to looping
- Avoid decoding bytes to
char
- Optimized grammar selection rules which also reduced allocations further
- Sane default formatting for arrays
- Added support for TOML 1.0, with one functional caveat and one format-preserving caveat
- Added
Item::into_value
- Changed
Table
and InlineTable
to be more Map-like
- Expanded support in
TableLike
- Added toml-rs-compatible API via the
toml_edit::easy
module for when developers want to ensure consistency between format-preserving and general TOML work, with one caveat.
- Exposed more control over formatting, with ability to modify any key or value whitespace.
- Fixed it so we preserve formatting on dotted keys in standard table headers
- Dropped
chrono
dependency
This release was sponsored by Futurewei
- Added
Table::decor
. #97
- Added
IterMut
for Table
. #100
- Added
Table::get_mut
. #106
- Updated
combine
to 4.5. #107
- Added format preserving mutation functions for
Array
. #88
array.push
now returns a Result
.