Commit graph

627 commits

Author SHA1 Message Date
Alex Crichton 7b50680c7d Bump to 0.3.0 2017-02-10 15:31:42 -08:00
Alex Crichton 67fb9f1953 Add a serialization helper to put tables last
This should help serializing maps where it's unknown up front whether the tables
and/or values come first.

Closes #142
2017-02-10 15:29:36 -08:00
Alex Crichton 5906fa71b5 Merge pull request #144 from tredoe/patch-1
Add Eq trait in main error
2017-02-10 15:09:34 -06:00
Jonas mg b5ec7d2c33 Update ser.rs 2017-02-10 14:37:47 +00:00
Alex Crichton 07874c7f94 Merge pull request #141 from shepmaster/prose
Minor prose fixes
2017-02-09 10:08:52 -08:00
Jake Goulding 90630d66fb Remove newline that causes strange rendering 2017-02-09 10:41:58 -05:00
Jake Goulding f49d0b3246 Tighten up the crate-level docs 2017-02-09 10:12:23 -05:00
Jake Goulding 22c3df7625 Grammar on Value doc strings 2017-02-09 10:09:20 -05:00
Alex Crichton d02c02d995 Implement Deserializer::set_require_newline_after_table 2017-02-08 21:36:38 -08:00
Alex Crichton 35ea81f136 Update metadata 2017-02-08 21:27:28 -08:00
Alex Crichton f49150f85b Merge pull request #137 from alexcrichton/serde-upgrade
Rewrite crate with serde support from ground up
2017-02-08 21:23:29 -08:00
Alex Crichton e256931e9b Rewrite crate with serde support from ground up
This commit completely rewrites this crate from the ground up,
supporting serde at the lowest levels as I believe serde support was
intended to do. This is a major change from the previous versions of
this crate, with a summary of changes being:

* Serialization directly to TOML is now supported without going through
  a `Value` first.

* Deserialization directly from TOML is now supported without going
  through a `Value`. Note that due to the TOML format some values still
  are buffered in intermediate memory, but overall this should be at a
  minimum now.

* The API of `Value` was overhauled to match the API of
  `serde_json::Value`. The changes here were to:

  * Add `is_*` accessors
  * Add `get` and `get_mut` for one-field lookups.
  * Implement panicking lookups through `Index`

  The old `index` methods are now gone in favor of `get` and `Index`
  implementations.

* A `Datetime` type has been added to represent a TOML datetime in a
  first-class fashion. Currently this type provides no accessors other
  than a `Display` implementation, but the idea is that this will grow
  support over time for decomposing the date.

* Support for the `rustc-serialize` crate has been dropped, that'll stay
  on the 0.2 and 0.1 release trains.

* This crate no longer supports the detection of unused fields, for that though
  you can use the `serde_ignored` crate on crates.io
2017-02-08 21:21:18 -08:00
Alex Crichton 4c358121bb Merge pull request #134 from SamWhited/patch-1
Add a latest version shield to the readme
2017-01-28 18:02:34 -08:00
Sam Whited 67855a21c5 Add a latest version shield to the readme 2017-01-27 19:04:31 -06:00
Alex Crichton 0dc5347946 Clarify that serde is supported
Closes #122
2017-01-09 17:37:05 -08:00
Alex Crichton 5907e0a7d0 Return encoding errors for NaN and infinite
TOML can't actually represent them, so we should bail out.

Closes #125
2016-12-30 17:40:40 -08:00
Alex Crichton f66b9913f9 Escape control characters when encoding strings
Closes #126
2016-12-30 17:34:11 -08:00
Alex Crichton 414a61cb84 Update travis token 2016-11-19 09:16:51 -08:00
Alex Crichton 659bbfa570 Touch up the decode example 2016-10-02 23:26:51 -07:00
Alex Crichton 552e785a2a Merge pull request #114 from kper/master
Add example for decoding toml to struct
2016-10-02 23:23:24 -07:00
kper b9d565e034 Add example for decoding toml to struct 2016-10-02 12:32:41 +01:00
Alex Crichton 530f112da8 Bump to 0.2.1 2016-09-08 14:48:30 -07:00
Alex Crichton 89ed04d201 Merge pull request #111 from nabijaczleweli/master
Don't space out the first table or array if not needed
2016-09-07 10:24:35 -07:00
nabijaczleweli 1e575d420c Add tests for checking for extraneous leading newlines (or lack thereof)
Couldn't find a better place to put this (the "valid" and "invalid"
tests are just for parser) so I made a new test module
2016-09-06 21:16:21 +02:00
nabijaczleweli 594b845b5a Don't space out the first table or array if not needed
Closes #110
2016-09-06 09:01:06 +02:00
Alex Crichton ccf3977221 Merge pull request #108 from vks/patch-2
Fix a typo
2016-08-16 14:49:31 -07:00
Vinzent Steinberg 2299cb3744 Fix a typo 2016-08-16 23:41:53 +02:00
Alex Crichton 0018fbe992 Merge pull request #107 from vks/patch-1
Update toml-rs version in README
2016-08-16 14:10:59 -07:00
Vinzent Steinberg 5489404551 Update toml-rs version in README 2016-08-16 22:39:14 +02:00
Alex Crichton b39768abf5 Remove Cargo.lock in serde-tests 2016-08-01 09:41:58 -07:00
Alex Crichton 1ed8fd555e Update serde-tests Cargo.lock 2016-08-01 09:41:18 -07:00
Alex Crichton 70d15bdcf3 Bump to 0.2.0 2016-08-01 09:30:16 -07:00
Alex Crichton 4ee9cb72e6 Touch up the encoder/decoder a bit
* Whitespace things
* Don't make `State` public
* Remove `#[cfg]` annotations
2016-07-29 10:23:06 -07:00
Alex Crichton b480a26f8d Merge pull request #105 from dtolnay/up
Update to serde 0.8.0
2016-07-29 09:22:22 -07:00
David Tolnay c17b75f834 Restore defaulted Deserializer methods 2016-07-29 00:55:52 -07:00
David Tolnay ae3028d4ee Bump serde dependency in serde-tests 2016-07-29 00:23:12 -07:00
David Tolnay 242b8038a1 Cfg off functions only needed for rustc-serialize or serde 2016-07-28 11:09:50 -07:00
David Tolnay 492690669e Update to serde 0.8.0 2016-07-28 11:09:40 -07:00
Oliver Schneider c7d96b191e next iteration 2016-07-15 16:24:26 +02:00
Oliver Schneider 183646b118 adjust for seq/map ser revamp 2016-07-14 15:28:51 +02:00
Alex Crichton fb8050d2d5 Merge pull request #101 from leodasvacas/clippy-run
Clippy run and implement Default for State and Enconder
2016-06-05 07:46:17 +02:00
leonardo.yvens e8097b14f1 Clippy run 2016-06-03 23:19:15 -03:00
Alex Crichton 7363dbe7f5 Merge pull request #103 from MarkSwanson/lookup-lifetime-enhancement
lookup() and lookup_mut() lifetime enhancements.
2016-06-01 12:36:30 -07:00
Alex Crichton 6f43fc3b29 Fix serde tests on nightly 2016-05-31 10:41:47 -07:00
Mark Swanson 3639e62a3b Rely on lifetime elision. 2016-05-31 10:20:43 -04:00
Mark Swanson 010e34f637 lookup() and lookup_mut() lifetime enhancements.
Rationale:

- The path has nothing to do with the result.
- The path has no need to live as long as the Value/self.
- In some cases it can be hard to actually build a path that meets
  the same lifetime requirements as the Value or String slice result.
2016-05-30 16:09:40 -04:00
Alex Crichton 44fc9d9f37 Require newlines to be present after keys
Closes #100
2016-05-22 23:30:43 -07:00
Alex Crichton 97592e120f Merge pull request #98 from zofrex/accept-empty-table
Accept empty table
2016-05-18 20:52:28 -07:00
James Sanderson dd7e31ea53 Refactor checking for EOF into method 2016-05-19 01:12:58 +01:00
James Sanderson 112adaaa3f Accept empty table on last line 2016-05-19 01:09:33 +01:00