Commit Graph

12 Commits (master)

Author SHA1 Message Date
Harvey Hunt 499e8c4bb3
examples: Allow dead code (#450)
The examples deny warnings, however a couple of examples deserialise TOML into
structs. The fields of these structs are never read, which breaks cargo test
in nightly mode.

Allow dead code to fix the CI build.
2021-11-09 13:28:06 -06:00
Eric Huss 6c162e6562 2018 edition idioms. 2019-05-08 17:37:38 -07:00
Alex Crichton c1a369f447 Run `cargo fmt` 2018-12-17 17:45:35 -08:00
Azriel Hoh 9ce37a6b02 Implemented enum tuple deserialization.
Issue #225
2018-11-10 11:07:23 +13:00
Azriel Hoh b6559e9e8d Added `NewType` variant to example. 2018-11-10 11:06:38 +13:00
Azriel Hoh eff2ed3b51 Implement deserialization for unit and struct variants.
Issue #225
2018-11-10 11:06:34 +13:00
Alex Crichton 9e53679093 Fix a number of compile warnings 2017-08-28 07:40:48 -07:00
Alex Crichton 7aa2594fb0 Add `extern crate serde` to examples/decode.rs
Closes #176
2017-05-15 14:30:18 -07:00
Alex Crichton f66d8bcf33 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 80c0cfd2f0 Touch up the `decode` example 2016-10-02 23:26:51 -07:00
kper 5280a6c768 Add example for decoding toml to struct 2016-10-02 12:32:41 +01:00
Alex Crichton e96e25bec7 Add a toml to json example 2015-06-07 23:47:29 -07:00