Commit Graph

716 Commits

Author SHA1 Message Date
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
Erick Tryzelaar
33633a5e14 Get everything to compile and fix some warnings 2015-02-11 11:24:53 -08:00
Erick Tryzelaar
1552eb72dc Add #[derive_deserialize] support for enums 2015-02-11 11:24:41 -08:00
Erick Tryzelaar
3fd42e616c Initial macro support for deserializing structs and tuple structs 2015-02-10 21:08:04 -08:00
Erick Tryzelaar
044825829a Update to rust HEAD 2015-02-10 07:50:43 -08:00
Erick Tryzelaar
4ca70c1396 Merge pull request #18 from tomprogrammer/rust-head
Update to rust nightly
2015-02-06 17:37:31 -08:00
Thomas Bahn
648ae2e3a3 Ignore serde2/Cargo.lock in git 2015-02-06 22:57:50 +01:00
Thomas Bahn
f18c28161d Follow rust std: Peekable changed signature 2015-02-06 22:27:19 +01:00
Thomas Bahn
70e8556e07 Follow rustc: New destructor semantics 2015-02-06 22:27:19 +01:00
Thomas Bahn
03820f3d78 Switch to rustc_serialize for tests 2015-02-06 22:27:19 +01:00
Thomas Bahn
f2a6f0e710 Follow rust std: fmt::Writer is implemented by String 2015-02-06 22:23:16 +01:00
Thomas Bahn
1cf41295c7 Add feature gate io 2015-02-06 22:23:16 +01:00
Thomas Bahn
a87fab9ecc Simplify some code using auto-deref 2015-02-06 22:23:16 +01:00
Thomas Bahn
81f84a4ea4 Remove unneeded mut specifiers 2015-02-06 22:23:16 +01:00
Thomas Bahn
79ff9fdafa Use the IntoIterator trait in for loops 2015-02-06 22:23:16 +01:00
Thomas Bahn
cb8492d74b Follow rust std: Error requires an implementation of fmt::Display 2015-02-06 22:23:16 +01:00
Thomas Bahn
5782657502 Follow rust std: The old io module is now called old_io 2015-02-06 22:23:16 +01:00
Thomas Bahn
9a284ae7c2 Follow rust std: fmt::Show was renamed to fmt::Debug 2015-02-06 22:23:16 +01:00
Thomas Bahn
5dd077969c Use slicing syntax instead of .as_slice() 2015-02-06 22:23:16 +01:00
Thomas Bahn
3022d7301a Use deref coercions when possible 2015-02-06 22:23:15 +01:00
Thomas Bahn
361acd37d0 Follow rust std: int, uint were renamed to isize, usize 2015-02-06 22:23:15 +01:00
Thomas Bahn
3b5d71fbb5 Add empty associated_types in expand_derive 2015-02-06 16:51:11 +01:00
Erick Tryzelaar
e2568ddfac Get the benchmark running again 2015-01-18 11:08:06 -08:00
Erick Tryzelaar
f7eb082339 Initial port of build_log 2015-01-18 10:05:13 -08:00
Erick Tryzelaar
cc40b0ec5e Update json::Value to work with associated types 2015-01-17 23:01:03 -08:00
Erick Tryzelaar
4fb427923b Support json deserialization 2015-01-17 22:37:17 -08:00
Erick Tryzelaar
f8fb17b2ff Convert json::ser to associated types 2015-01-17 22:20:28 -08:00