Skip to content

Commit

Permalink
update README limitations section
Browse files Browse the repository at this point in the history
  • Loading branch information
alsuren committed Jun 23, 2019
1 parent c3bb4ca commit 64582e6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ c = { d = "hello" }

## Limitations

*Things it does not preserve:
Things it does not preserve:
* Different quotes and spaces around the same table key, e.g.
```toml
[ 'a'. b]
Expand All @@ -56,15 +56,17 @@ will be represented as (spaces are removed, the first encountered quote type is
['a'.c]
['a'.d]
```
* Children tables before parent table (tables are reordered, see [test]).
* Scattered array of tables (tables are reordered, see [test]).
* Children tables before parent table (tables are reordered by default, see [test]).
* Scattered array of tables (tables are reordered by default, see [test]).

The reason behind the first limitation is that `Table` does not store its header,
allowing us to safely swap two tables (we store a mapping in each table: child key -> child table).

This last two limitations allow us to represent a toml document as a tree-like data structure,
which enables easier implementation of editing operations
and an easy to use and type-safe API.
and an easy to use and type-safe API. If you care about the above two cases, you
can use `Document::to_string_in_original_order()` to reconstruct tables in their
original order.

## License

Expand Down

0 comments on commit 64582e6

Please sign in to comment.