Commit Graph

997 Commits

Author SHA1 Message Date
Erick Tryzelaar
f4c8ad6c3a feat(de): Don't expose primitive 2016-02-23 20:38:06 -08:00
Erick Tryzelaar
57433e1eaa feat(codegen): Optimize deserializing fields from byte strings 2016-02-23 20:38:06 -08:00
Erick Tryzelaar
118476b98b feat(de): Rename de::Error trait methods 2016-02-23 20:21:07 -08:00
Erick Tryzelaar
6caf8a0074 fix(error): Report UnknownVariant and InvalidValue
Don't unify it with syntax errors.
2016-02-23 20:21:07 -08:00
Erick Tryzelaar
96483ee54f Merge pull request #246 from erickt/master
feat(cargo): Version bump to 0.7!
2016-02-23 20:20:52 -08:00
Erick Tryzelaar
6a9216f26a Merge pull request #248 from Yoric/v0.6.x
Resolves #183 - Serialize and Deserialize for PhantomData
2016-02-23 20:20:23 -08:00
David Rajchenbach-Teller
4bba342e42 Resolves #183 - Serialize and Deserialize for PhantomData 2016-02-23 21:43:50 +01:00
Erick Tryzelaar
2987b0d10a Merge pull request #245 from erickt/master
feat(serde): Add hooks for fixed-sized arrays
2016-02-23 05:32:56 -08:00
Erick Tryzelaar
d6a50b8977 feat(cargo): Version bump to 0.7! 2016-02-23 05:26:07 -08:00
Erick Tryzelaar
76b3dead9b feat(serde): Add hooks for fixed-sized arrays
Closes #244
2016-02-23 05:15:44 -08:00
Erick Tryzelaar
d24b2c86f2 Tagging for release
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJWyzcUAAoJEKwwZL55kszf9K8H/2Ab+jvc5xvmi7no+iIpX7me
 9uMo7Fbj1NY16GPPiApiZSCArX5/Dhqikoje/8xKbpJIf8GwTWxUB8HVTaiiZuAa
 KMC3kJP/vbnnJuoTtzZPW7wLQHBQudefDh7HsMF1wQ3zFqICvHkoQlwwvm7OCusJ
 q11tYZfeZTtaCnpF5SQpilvhO3kb5beDmuyHLM9w9pZlVzk+9jg+NiZbwkG7vv3K
 1I35F6UFFmS+rN/Rq7XnuZRrs67b13qpREwAbprV54CD44ENGHSh83uYAc8x7kQr
 cM0qs+3SNslXzz9cwkrUi5O9WOjhgUVo9AaW901oeFy/xEHNHOBYESI5cd3ISCY=
 =WfrH
 -----END PGP SIGNATURE-----

Merge tag 'v0.6.15'

Tagging for release
2016-02-22 08:32:05 -08:00
Erick Tryzelaar
b6965ecde8 feat(cargo): Version bump 2016-02-22 08:15:17 -08:00
Erick Tryzelaar
b3d5de3b92 Merge pull request #243 from erickt/master
feat(de): Remove dependency on the `num` crate.
2016-02-22 08:08:23 -08:00
Erick Tryzelaar
49b0bfd257 feat(de): Remove dependency on the num crate. 2016-02-21 21:22:58 -08:00
Erick Tryzelaar
1132c0b0e1 Merge pull request #242 from erickt/master
feat(impls): Add impls for std::net::Ip{,v4,v6}Addr
2016-02-21 20:47:38 -08:00
Erick Tryzelaar
4cb5ee0678 feat(impls): Add impls for std::net::SocketAddr{,V4,V6} 2016-02-21 20:21:21 -08:00
Erick Tryzelaar
b257084f3a feat(impls): Add impls for std::net::Ip{,v4,v6}Addr 2016-02-21 20:21:21 -08:00
Erick Tryzelaar
c03587f0bf Merge remote-tracking branch 'remotes/origin/v0.6.x' 2016-02-21 20:05:38 -08:00
Erick Tryzelaar
96526dfd66 Merge pull request #241 from erickt/master
feat(de): Add an Error::unknown_variant error.
2016-02-21 17:42:02 -08:00
Erick Tryzelaar
740865b637 feat(de): Add an Error::unknown_variant error.
Closes #169
2016-02-21 16:26:52 -08:00
Erick Tryzelaar
4d10eef55d doc(serde): Document the visit_string method
Closes #184
2016-02-21 16:03:33 -08:00
Erick Tryzelaar
7adf624dee Merge pull request #238 from erickt/skip4
Add codegen expr magic for default, skip serializing, and alternative serializers
2016-02-21 15:38:31 -08:00
Erick Tryzelaar
78cf29d1d1 feat(codegen): Switch attributes to using using paths not expressions 2016-02-21 15:28:25 -08:00
Erick Tryzelaar
3f3cffe317 Merge pull request #240 from kevinmehall/nightly
Fix cargo `nightly` feature
2016-02-21 13:28:54 -08:00
Kevin Mehall
4e7b0ac089 Fix cargo nightly feature
517c2f79b7 renamed the `nightly` feature to `nightly-testing` to
reflect that the `clippy` dependency is only required when testing.
However, the code also uses `#[cfg(feature = "nightly")]` to enable
trait impls for feature-gated types. This commit restores that
functionality and fixes a few `cfg_attr`s that refer to clippy lints.
2016-02-21 13:01:04 -08:00
Erick Tryzelaar
0c35ce0a4f feat(codegen): Improve error messages in annotations 2016-02-21 09:54:03 -08:00
Erick Tryzelaar
dbd05ae9cc doc(annotations): Add docs for the latest documentation 2016-02-18 19:32:10 -08:00
Erick Tryzelaar
c268eb2258 feat(codegen): Remove #[serde(skip_serializing_if_{none,empty})]
`#[serde(skip_serializing_if="...")]` can replace this functionality.
2016-02-18 19:31:43 -08:00
Erick Tryzelaar
40f8e6b061 feat(codegen): Add #[serde(deserialize_with="...")]
This allows a field to be deserialized with an expression instead
of the default deserializer. This simplifies deserializing a struct
or enum that contains an external type that doesn't implement
`serde::Deserialize`. This expression is passed a variable
`deserializer` that needs to be used to deserialize the expression.
2016-02-18 19:13:55 -08:00
Erick Tryzelaar
001cb7ab01 feat(codegen): Add #[serde(serialize_with="...")]
This allows a field to be serialized with an expression instead
of the default serializer. This simplifies serializing a struct
or enum that contains an external type that doesn't implement
`serde::Serialize`. This expression is passed a variable
`serializer` that needs to be used to serialize the expression.
2016-02-18 19:13:55 -08:00
Erick Tryzelaar
de89f95f31 feat(codegen): Add support for #![serde(skip_serialize_if="$expr")]
This allows end users to use an arbitrary expression to decide whether
or not to serialize some field. This expression has access to all the
fields in the struct, but none of the internal state of the Serialize
implementation. For structs, serde implements this by creating a
temporary trait and implementing the struct for it. For struct variants,
the fields are copied by reference into a temporary struct first
before implementing the temporary trait.

This also fixes a bug where the serde_codegen wasn't making calls to
Serializer::serialize_{tuple,struct}_variant{,_elt}.
2016-02-18 19:13:55 -08:00
Erick Tryzelaar
9812a4c9c6 feat(codegen): Allow #[serde(default="123")]
This feature adds support for the default to be specified to be
some expression (which unfortunately needs to be parsed from
a string) without needing this value to have an implementation
of `Default`, or for a new-type wrapper in order to provide an
alternative implementation. This expression is run in a function,
and therefore has no access to any of the internal state of
the deserializer.
2016-02-18 19:13:55 -08:00
Erick Tryzelaar
8ea6c66cf7 refactor(tests): Rename and move some structs and enums 2016-02-18 19:13:55 -08:00
Erick Tryzelaar
17bf789708 Merge branch 'v0.6.x' 2016-02-18 09:46:46 -08:00
Erick Tryzelaar
f6a66a5537 feat(cargo): Rustup to latest nightly 2016-02-18 09:27:41 -08:00
Erick Tryzelaar
1236889664 Merge branch 'v0.6.x'
# Conflicts:
#	serde_codegen/src/de.rs
2016-02-14 16:45:59 -08:00
Erick Tryzelaar
fd5ab8c5c8 feat(cargo): Version bump 2016-02-13 22:06:08 -08:00
Erick Tryzelaar
39fa78e2ec Merge pull request #236 from debris/rustup3
Update serde_codegen for rustc 1.8.0-nightly (ce4b75f25 2016-02-12)
2016-02-13 21:56:07 -08:00
debris
e18416ac7f updated serde_tests deps 2016-02-14 03:43:37 +01:00
debris
b63cc13f3a updated clippy to 0.0.41 2016-02-14 03:33:58 +01:00
debris
74b230c183 Update serde_codegen for rustc 1.8.0-nightly (ce4b75f25 2016-02-12) 2016-02-14 03:27:20 +01:00
Erick Tryzelaar
561a373d19 Merge branch 'v0.6.x'
# Conflicts:
#	serde/src/de/mod.rs
#	serde_codegen/src/attr.rs
#	serde_codegen/src/de.rs
#	serde_codegen/src/lib.rs
2016-02-12 21:43:23 -08:00
Erick Tryzelaar
064241f03c fix(serde): Rename visit_struct_key to visit_struct_field
This is more consistent with the rest of the serde naming patterns.
2016-02-12 21:22:42 -08:00
Erick Tryzelaar
32163cd53b feat(cargo): Version bump 2016-02-12 21:06:47 -08:00
Erick Tryzelaar
3a5aa00262 fix(codegen): Fix clippy cfg_attr 2016-02-12 20:21:52 -08:00
Erick Tryzelaar
c3f15fd7f8 Merge pull request #234 from jwilm/fix-clippy-feature
plugin(clippy) now relies on feature = "clippy"
2016-02-10 11:44:51 -08:00
Joe Wilm
9985d2ebfc plugin(clippy) now relies on feature = "clippy"
Was previously nightly. This resulted in compilation error when the
clippy feature was not enabled because the clippy crate could not be
found.
2016-02-10 11:42:33 -08:00
Erick Tryzelaar
46f88037db Merge branch 'v0.6.x' 2016-02-08 14:17:26 -08:00
Erick Tryzelaar
7a3e3a61f4 chore(tests): Silence some warnings 2016-02-08 13:37:03 -08:00
Erick Tryzelaar
517c2f79b7 chore(cargo): Only depend on clippy when testing 2016-02-08 13:35:26 -08:00