Commit Graph

1142 Commits

Author SHA1 Message Date
Erick Tryzelaar
ddfaf9d177 Add Deserializer::visit_enum to help json enum deserialization 2015-03-05 19:17:18 -08:00
Erick Tryzelaar
1b632cea9c Remove unnecessary inlines 2015-03-05 07:35:55 -08:00
Hugo Duncan
3c4eddc7f8 Fix plugin use of de::SeqVisitor
When compiling a module with a struct containing a derive_deserialize
annotation, the compiler was complaining "Use of undeclared type or
module `de`".
2015-03-04 17:40:45 -05:00
Erick Tryzelaar
e7ce710da5 Fix parsing json into optional types
Does not yet handle parsing missing values as `None` yet though.
Closes #25.
2015-03-04 09:45:11 -08:00
Erick Tryzelaar
e9f356755f Add json value deserializer 2015-03-04 09:45:11 -08:00
Erick Tryzelaar
cd3cad8ef5 Fix serializing json enums 2015-03-04 09:45:11 -08:00
Erick Tryzelaar
4b2354597d Start fixing the json tests 2015-03-04 09:44:56 -08:00
Erick Tryzelaar
6685d76e2c Initial switch to syntax_ast_builder 2015-03-04 07:07:04 -08:00
Erick Tryzelaar
b2f52df5ff Fix serializing json objects 2015-03-03 21:55:48 -08:00
Erick Tryzelaar
6382441f2e Rename the json tests 2015-03-03 21:47:42 -08:00
Erick Tryzelaar
189b3f0394 Add test for #[derive_serialize] for structs 2015-03-03 21:42:33 -08:00
Erick Tryzelaar
4db8b732f1 Simplify test_de 2015-03-03 21:35:49 -08:00
Erick Tryzelaar
37bc3e9df3 Fix #[derive_deserialize] for deserializing empty sequences named units 2015-03-03 21:33:51 -08:00
Erick Tryzelaar
79a7bc9bf2 convert to where clauses 2015-03-03 21:27:07 -08:00
Erick Tryzelaar
098cd335ce Factor de tests into it's own file 2015-03-03 21:19:55 -08:00
Erick Tryzelaar
7a170e1b2c Fix #[derive_serialize] for enum struct variants 2015-03-03 21:17:40 -08:00
Erick Tryzelaar
fe64145c06 Fix #[derive_serialize] for tuple structs 2015-03-03 21:14:43 -08:00
Erick Tryzelaar
61fdcb0611 Add the json tests 2015-03-03 20:33:25 -08:00
Erick Tryzelaar
b5314aac11 Factor the ser tests into it's own module 2015-03-03 20:33:17 -08:00
Erick Tryzelaar
4ff4165da6 Fix serializing named units 2015-03-03 20:29:59 -08:00
Erick Tryzelaar
ecc19bdbdb Convert over to where clauses 2015-03-03 19:34:16 -08:00
Erick Tryzelaar
033b039284 Merge commit 'c5a35e388ca2ab34937b654c09129b05d91982dc'
# Conflicts:
#	serde2/serde2_macros/src/lib.rs
2015-03-03 17:55:18 -08:00
Erick Tryzelaar
1182ad0223 Fix tests, make Deserializer::visit take a value not a reference 2015-03-03 11:09:09 -08:00
Erick Tryzelaar
9904d32ff9 Fix serde2_macros and benchmarks, and silence some warnings 2015-03-03 11:07:33 -08:00
Erick Tryzelaar
dd4f7537ea Merge pull request #22 from hugoduncan/feature/add-field-aliases
Add aliases on struct fields
2015-03-03 08:25:37 -08:00
Hugo Duncan
1c0a16f719 Add aliases on struct fields
Allow specification of an alias on a struct field with
the #[serde(alias="SomeAlias"] attribute.

Addresses #13
2015-03-02 17:20:23 -05:00
Hugo Duncan
bb1a9b2389 Add serde default attribute for fields
When annotated with #[serde(default)], a field gets a default value
using std:default::Default, and will not error when decoding if the
field is missing from the input.

Addresses #9

Refactor default_value to use if-let
2015-03-02 17:20:22 -05:00
Erick Tryzelaar
5c4327cd16 Silence a warning 2015-02-25 08:14:20 -08:00
Erick Tryzelaar
d4dcf8e75d A really ugly hack to get generic enum serialization 2015-02-25 07:22:44 -08:00
Erick Tryzelaar
adc6057574 Merge pull request #24 from tomprogrammer/rust-head
Update serde2 to compile on nightly 2015-02-21
2015-02-24 07:04:50 -08:00
Thomas Bahn
399231ad5e Follow rust std: Use full range for slicing 2015-02-24 10:53:42 +01:00
Thomas Bahn
0388c69228 Follow rust: Suffix us is replaced by usize 2015-02-24 10:52:54 +01:00
Thomas Bahn
61c38127af Follow rust std: Stabilized Hash and introduced PhantomData 2015-02-24 10:52:10 +01:00
Thomas Bahn
e9c7ea1a64 Follow rustc: Compiler internals changed 2015-02-24 10:45:34 +01:00
Hugo Duncan
c5a35e388c Refactor default_value to use if-let 2015-02-20 13:59:14 -05:00
Hugo Duncan
b6fc68c030 Add serde default attribute for fields
When annotated with #[serde(default)], a field gets a default value
using std:default::Default, and will not error when decoding if the
field is missing from the input.

Addresses #9
2015-02-20 13:18:09 -05:00
Erick Tryzelaar
5f46adb2d0 Merge pull request #20 from inrustwetrust/json-parser-trailing-whitespace
Make the JSON parser accept trailing whitespace
2015-02-19 08:36:36 -08:00
Erick Tryzelaar
3fac47e01c Fix #[derive_serialize] for enums 2015-02-19 08:35:42 -08:00
inrustwetrust
fb77b13174 Make the JSON parser accept trailing whitespace 2015-02-18 20:39:24 +01:00
Erick Tryzelaar
65cfcd03f8 Port serde2 to std::io, which cuts the speed by 26% :( 2015-02-16 18:17:50 -08:00
Erick Tryzelaar
4e4172ec85 Merge pull request #19 from tomprogrammer/fix-json-object-delimiter
Fix the json object delimiters
2015-02-16 12:29:19 -08:00
Thomas Bahn
d43946b6a6 Fix the json object delimiters
Write "{" instead of "{{". Same for the counterpart.
2015-02-16 20:50:41 +01:00
Erick Tryzelaar
a995e16995 Clean up some dead code from the bench_log.rs 2015-02-16 07:22:58 -08:00
Erick Tryzelaar
c327eb50fd get serde to compile 2015-02-15 22:03:32 -08:00
Erick Tryzelaar
67d7ac4468 Update and tweak some names 2015-02-15 21:07:17 -08:00
Erick Tryzelaar
1f98ee0d8f Use writer.write_all(b"...") instead of write! for static strings 2015-02-14 10:19:15 -08:00
Erick Tryzelaar
004a89510e ported over to the new std::io, but it's half the speed of std::old_io 2015-02-14 10:01:22 -08:00
Erick Tryzelaar
4dccf8cdec Clean up warnings in serde 2015-02-13 10:26:13 -08:00
Erick Tryzelaar
b70d77b5c9 Cleanup code, fix some incompatibilites with rust head 2015-02-13 09:40:47 -08:00
Erick Tryzelaar
5bce95f3e7 Use #[derive_deserialize] 2015-02-11 11:24:53 -08:00