Skip to content
This repository has been archived by the owner on Sep 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #278 from Kerollmops/master
Browse files Browse the repository at this point in the history
Add the preserve_order feature (rebased version)
  • Loading branch information
alexcrichton authored Jan 8, 2019
2 parents d0977ab + 0372ba6 commit 56f9afb
Show file tree
Hide file tree
Showing 7 changed files with 628 additions and 15 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ matrix:
branch: master
script:
- cargo test
- cargo test --features preserve_order
- cargo test --manifest-path test-suite/Cargo.toml
- rustdoc --test README.md -L target
notifications:
Expand Down
11 changes: 10 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "toml"
version = "0.4.10"
version = "0.5.0"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT/Apache-2.0"
readme = "README.md"
Expand All @@ -23,7 +23,16 @@ travis-ci = { repository = "alexcrichton/toml-rs" }

[dependencies]
serde = "1.0"
linked-hash-map = { version = "0.5", optional = true }

[dev-dependencies]
serde_derive = "1.0"
serde_json = "1.0"

[features]
default = []

# Use LinkedHashMap rather than BTreeMap as the map type of toml::Value.
# This allows data to be read into a Value and written back to a TOML string
# while preserving the order of map keys in the input.
preserve_order = ["linked-hash-map"]
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@

#[macro_use]
extern crate serde;
#[cfg(feature = "preserve_order")]
extern crate linked_hash_map;

pub mod map;
pub mod value;
#[doc(no_inline)]
pub use value::Value;
Expand Down
Loading

0 comments on commit 56f9afb

Please sign in to comment.