Commit Graph

2281 Commits

Author SHA1 Message Date
David Tolnay
4fdba725fe
Revert "Support deserialization of struct keys from integers"
This is not as useful as expected because the Serializer does not know the real
index of each struct field being serialized. The best it can do is keep a
counter, which goes wrong if fields are conditionally skipped.

This reverts commit eec7101894.
2017-06-18 09:11:21 -07:00
David Tolnay
75eed8cdde Merge pull request #958 from serde-rs/unused
Fix unused seq and map macros
2017-06-17 19:14:39 -07:00
David Tolnay
6801a13650
Fix unused seq and map macros 2017-06-17 19:01:12 -07:00
David Tolnay
25ab84d4b9 Merge pull request #957 from serde-rs/alloc
Merge crate `collections` into `alloc`
2017-06-17 18:59:43 -07:00
David Tolnay
e43d3f3e4f
Merge crate collections into alloc 2017-06-17 18:35:56 -07:00
David Tolnay
b37d47c987 Merge pull request #956 from sfackler/int-field
Support deserialization of struct keys from integers
2017-06-17 18:26:45 -07:00
Steven Fackler
eec7101894 Support deserialization of struct keys from integers
serde-cbor supports a "packed" serialization flag which causes keys to
be serialized as their indices, but the deserializer currently has to
hardcode support for this format. We can simply support deserialization
of struct keys from integers as we already do for enum variants.
2017-06-17 18:12:07 -07:00
Wangshan Lu
5dd327fb02 Support std::time::SystemTime 2017-06-04 16:39:03 +08:00
David Tolnay
fd3d1396d3
Release 1.0.8 2017-05-24 00:17:27 -07:00
David Tolnay
c47b4c8e0b
Release 1.0.7 2017-05-19 17:00:31 -07:00
David Tolnay
2d793b82f6 Merge pull request #940 from BurntSushi/ag-deser-borrowed
add borrowed value deserializers
2017-05-19 16:59:55 -07:00
Andrew Gallant
237be46e29
add borrowed value deserializers
This adds two new types to the `de::value` module,
`BorrowedStrDeserializer` and `BorrowedBytesDeserializer`. A
`BorrowedStrDeserializer` is just like `StrDeserializer`, except the
lifetime of the string is tied to the lifetime of the deserializer. This
can be useful when, for example, deserializing into a
`HashMap<&str, &str>` when the keys/values are tied to the deserializer
itself.

The `BorrowedBytesDeserializer` has no analog, but it's the same as
`BorrowedStrDeserialize` except for `&[u8]` instead of `&str`.
2017-05-19 19:55:34 -04:00
David Tolnay
3d7aad1e7b
Release 1.0.6 2017-05-17 08:20:54 -07:00
David Tolnay
e792874369 Merge pull request #935 from spikefoo/combined-skip
Add a combined skip attribute
2017-05-16 09:13:49 -07:00
spikefoo
1669c69714 Add a combined #serde[(skip)] field attribute 2017-05-16 12:33:26 +03:00
David Tolnay
4d5e450054
Release 1.0.5 2017-05-14 12:53:48 -07:00
David Tolnay
26b22e647d Merge pull request #933 from serde-rs/contentstr
Fix internally tagged struct variant containing unit variant containing borrowed string
2017-05-14 12:53:07 -07:00
David Tolnay
cda1fc46b0
Fix internally tagged struct variant containing unit variant containing borrowed string 2017-05-14 12:39:42 -07:00
David Tolnay
c68b959696
Release 1.0.4 2017-05-10 20:05:22 -07:00
David Tolnay
eab80172e4 Merge pull request #926 from serde-rs/borrow
Support borrowing within internally tagged enum
2017-05-10 20:04:36 -07:00
David Tolnay
c1259fbc87
Support borrowing within internally tagged enum 2017-05-10 19:56:05 -07:00
David Tolnay
58e30eaee4
Release 1.0.3 2017-05-10 10:15:39 -07:00
David Tolnay
bafa941004 Merge pull request #924 from pshc/deserialize-borrowed-path
impl Deserialize for &'a Path
2017-05-10 10:14:25 -07:00
Paul Collier
f347b2d363 impl Deserialize for &'a Path 2017-05-10 13:03:03 -04:00
David Tolnay
3f9fc49cca Merge pull request #922 from serde-rs/nonzero
Removed Deref impl for NonZero
2017-05-09 19:58:17 -07:00
David Tolnay
c913527944
Removed Deref impl for NonZero 2017-05-09 19:48:54 -07:00
David Tolnay
8fafc7420c
Release 1.0.2 2017-04-27 12:32:30 -07:00
David Tolnay
bea1c5b0f5
Remove trailing whitespace 2017-04-27 12:31:13 -07:00
David Tolnay
aa37caf216 Merge pull request #905 from TedDriggs/adjacent_tag_enums
Fix #816 - adjacently-tagged enums honor deny_unknown_fields
2017-04-27 12:27:31 -07:00
Ted Driggs
2440b59aae Address feedback on PR #905
* Added error test when deny_unknown_fields enabled
* Fixed next_relevant_key to use absolute paths
2017-04-27 12:21:32 -07:00
Ted Driggs
873cfbe9ab Fix #816 - adjacently-tagged enums honor deny_unknown_fields 2017-04-27 11:24:09 -07:00
David Tolnay
c96efcb87a Merge pull request #900 from SuperFluffy/macro_to_derive_input
Replace deprecated MacroInput; completes c52e131
2017-04-25 08:10:26 -07:00
Richard Janis Goldschmidt
b53026a21b Replace deprecated MacroInput; completes c52e13 2017-04-25 11:08:56 +02:00
David Tolnay
c7901e532e
Release 1.0.1 2017-04-23 16:40:56 -07:00
David Tolnay
2af0701be6 Release 0.9.15
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJY/TrWAAoJEPm6FDuV/22CN1wQAJiKy4Rk3pQ8wgjS2rAkkIU4
 F4pFNNvTEIjz7sqZS22jKjTjw4Fa2+v6lriv/owWwpDDqQe7VH6/0qA66YhD0sxq
 iX3K+pyf5aG0Wj2onv7SaCFMfGxZX5nVubaEgw4esER9NqZDhNU70DpixDiQBekE
 gFsfWom31ulbcwQkUpH4updG2kCXClFVtZlSHKBpv/EQptAz1gjxEdhB9Wax7Ckm
 sxHk4oq2xPZTwEvWku6bhPSNC0g1P2HaWVe4NSlWcsJHq/mdrqnttOAlMgve1Kqy
 oS3pSdf1xbqNdzDIpOZZpDrz3HiP0TG9kvmL8DSucSv0DVhX4UQhsyQlREcY8zzg
 UJwFC2lWhYmZ6gMe2ExHV0WCZoKZH6DSLC3osue4LmC0niy7+MOMo9pPPYytHNx8
 24QSOGwb9DF5tmMDp0dt8yMOAyHV6vOxA3FnIcv3AuJlYu+Mcp3QPTThNUo36rZ2
 ThJvmWoaimIZGOT2K73reV4WjEGD0cmlINEL/W87UCCiAs14T1/3ttPmN3ACGVOk
 E06tWo7MEhzzo1sR36mFmP5NDnXvJpydmZCX0RK02qaPuhyN/1MuQ+8w/Zh5wnUZ
 fugomHfsd0x1uOF5fbtqGw9gLGx7vZADvF/Wnzw3uu7UPloSGq7fjE74X69CKhkb
 S92/a+c0AOMEoeO64gLU
 =PIhT
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJY/Ts8AAoJEPm6FDuV/22CPS0P/2mwTNCUnuBBB7nngxlEKZaL
 WMx8asNtVp7O4r8KoA8AMibbQ0PaMSBN52B7LdVN0IPwVnPVztwLtP+i96M9/oaB
 2ynHmLRFFaOspcZ0j+BHwQALXSf5paNnBQXEPFqiX/izlyNYLkGWOMN81JnKpNQk
 E0MiISLPadJxnuxjfBwAJsXVYvEod6it8JSRCp56/z1SrMlk2Ijpdh7JLi9oAu4p
 w8A7TPy/CKBmu8SN7oNCQmu1E0KGtgF3JtBfxG9x6FuSE2VyFDq02Op5thZZC9Ge
 rX9oVE0EGPW3OnrHBYf3BNd2xFTESTO3EoWnUit6QUUCjhrOJ7tCN7XVnhcu/xOE
 XTfN/0kwCCwlKJ5NAngrLkU+pnR5xf2xkNlCc42zrGWZuqcsOE4b6t0dFKRTHxZj
 FMx8M+j8/7H4VxzBZKW6XFypPVh4Fw7iFSG2OQ+U5JhuobgxUR8FHT8/cTUxV8s6
 gVwPJF1nQPU5x+WW+HsN+8DKMBDs9C9ATsSzkozP4F2cjFFdz9X1f+vYdFGStPxd
 +X91PcVUPBbshWfUo6sLjTKzJ6+eLcnZTbcVZO/bKbiBNsjfu4zSePXCZxEKwOkp
 Idt9JyAyULrC97NrPcfijZmGkvVDJ53rF15kDSj2TS46PJlxhsoiY91tsEcNHU94
 n3QeXKhzItZWgA0/3G5z
 =0Xli
 -----END PGP SIGNATURE-----

Merge tag 'v0.9.15' into 'origin/master'
2017-04-23 16:39:32 -07:00
David Tolnay
ae79451b7a
Release 0.9.15 2017-04-23 16:37:43 -07:00
David Tolnay
b220f264a5 Merge pull request #898 from SimonSapin/z-is-dead
Remove usage of unstable core::num::Zero, which was removed upstream.
2017-04-23 16:35:57 -07:00
David Tolnay
1a2b3815ef Merge pull request #899 from SimonSapin/z-is-dead-in-0.9-too
Remove usage of unstable core::num::Zero, which was removed upstream.
2017-04-23 16:34:06 -07:00
Simon Sapin
6fbf40b83c Remove usage of unstable core::num::Zero, which was removed upstream.
https://github.com/rust-lang/rust/pull/41437
2017-04-24 08:29:38 +09:00
Simon Sapin
1d6ecf3c2c Remove usage of unstable core::num::Zero, which was removed upstream.
https://github.com/rust-lang/rust/pull/41437

Backport of https://github.com/serde-rs/serde/pull/898 to 0.9.x
2017-04-24 08:25:08 +09:00
David Tolnay
d7ccef0cac
Release 1.0.0 2017-04-20 08:19:31 -07:00
David Tolnay
2d465415c5
Take credit 2017-04-20 08:13:46 -07:00
David Tolnay
bc2d637112
Cut an internals release 2017-04-20 08:11:31 -07:00
David Tolnay
cf1cdadc77
Fix some rustfmt screwups 2017-04-19 15:56:22 -07:00
David Tolnay
4a9cb3395d
Fix the serialize_bytes doc test 2017-04-19 15:03:02 -07:00
David Tolnay
dfa6623a24
Encourage serialize_entry 2017-04-19 14:56:52 -07:00
David Tolnay
a8adac6b93
Document misuse of SerializeMap 2017-04-19 14:55:28 -07:00
David Tolnay
b9b7922ef1
Naming for &str and &[u8] is more like primitives 2017-04-19 14:53:15 -07:00
David Tolnay
a369ee156f
Run serde_test doc tests in Travis 2017-04-19 14:45:06 -07:00
David Tolnay
d1253cb193
Minimal serde_derive documentation
Fixes #886.
2017-04-19 14:43:53 -07:00