Commit graph

12 commits

Author SHA1 Message Date
Harvey Hunt b0035e905c 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 0737f0b27a 2018 edition idioms. 2019-05-08 17:37:38 -07:00
Alex Crichton cbfc4e18f8 Run cargo fmt 2018-12-17 17:45:35 -08:00
Azriel Hoh 4f28c2f639 Implemented enum tuple deserialization.
Issue #225
2018-11-10 11:07:23 +13:00
Azriel Hoh 9a69c17a4e Added NewType variant to example. 2018-11-10 11:06:38 +13:00
Azriel Hoh f5d14af5a6 Implement deserialization for unit and struct variants.
Issue #225
2018-11-10 11:06:34 +13:00
Alex Crichton dd4c5131eb Fix a number of compile warnings 2017-08-28 07:40:48 -07:00
Alex Crichton 5170d66d51 Add extern crate serde to examples/decode.rs
Closes #176
2017-05-15 14:30:18 -07: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 659bbfa570 Touch up the decode example 2016-10-02 23:26:51 -07:00
kper b9d565e034 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