Commit Graph

1639 Commits

Author SHA1 Message Date
David Tolnay
59ec931d8f
Release 0.9.9 2017-02-24 13:57:52 -08:00
David Tolnay
4b3c5ea99e
Fix clippy lint in content serializer 2017-02-24 13:56:44 -08:00
David Tolnay
d4ea4a7eef
Add test for enums containing enums
Fixes #775.
2017-02-24 13:50:47 -08:00
David Tolnay
5fbdadefb2
Deserializing enums in serde_test 2017-02-24 13:47:04 -08:00
David Tolnay
4da77e4200
Serialize to Content 2017-02-24 12:59:35 -08:00
David Tolnay
d797504407
Deserialize enums from &Content 2017-02-24 09:32:14 -08:00
David Tolnay
8e5f472e27 Merge pull request #787 from 46bit/issue-775
Fix internally tagged enums by implementing ContentDeserializer::deserialize_enum
2017-02-22 18:23:18 -08:00
David Tolnay
5e7883945b
Fix clippy lint in Content::unexpected 2017-02-22 18:16:51 -08:00
David Tolnay
a4bd6b9a96
Fix content's SeqDeserializer on no_std 2017-02-22 18:14:56 -08:00
Michael Mokrysz
4c253748c2 Compiles and fixes internally tagged testcases. 2017-02-23 01:05:44 +00:00
Michael Mokrysz
8f6e1fb5b3 Resolved error typing. Needs to adapt to Content::Map with non-String keys.
`EnumDeserializer` is being adapted from:
  `serde_json::Value::Map<Vec<(String, Value)>>`
serde has a Map variant that allows non-String keys:
  `serde:🇩🇪:Content::Map<Vec<(Content, Content)>>`

There's a lot of assumptions in `EnumDeserializer` about `String` keys and I'm not sure what the adaptation should be.
2017-02-22 23:59:47 +00:00
Michael Mokrysz
4e665a71bd Attempt to port serde_json::Value::deserialize_enum for ContentDeserializer is being derailed by what error types should be used. 2017-02-22 22:55:18 +00:00
David Tolnay
017e6d304f
Release 0.9.8 2017-02-21 10:59:42 -08:00
David Tolnay
89cbb81673
Include readme and licenses in crates.io archive
Fixes #772.
2017-02-20 21:11:57 -08:00
David Tolnay
c36743fa05 Merge pull request #782 from serde-rs/adjacent
Deserialization of Haskell style enums
2017-02-20 21:04:17 -08:00
David Tolnay
9a3c1243f4
Deserialization of Haskell style enums 2017-02-20 20:05:06 -08:00
David Tolnay
599a1b6607
Fragments that keep track of type of syntax
Fixes #777.
2017-02-20 17:12:35 -08:00
David Tolnay
3d6e086d3e
Support custom paths in container attribute serde(default="...") 2017-02-20 17:06:00 -08:00
David Tolnay
ad480d2b04 Merge pull request #780 from Thomasdezeeuw/default_container
Add support for `#[serde(default)]` on structs
2017-02-20 16:10:28 -08:00
Thomas de Zeeuw
7bee779514 Only allow #[serde(default)]` on structs 2017-02-21 00:15:00 +01:00
David Tolnay
dff919a926
Rename __simple_value to __field0 to be consistent with tuples 2017-02-20 14:16:54 -08:00
David Tolnay
bac593573c
Drop aster dependency 2017-02-20 13:50:17 -08:00
Thomas de Zeeuw
9444db5f19 Add support for #[serde(default)] on structs
This allows structs to use the default value for each field defined in
the struct’s `std::default::Default` implementation, rather then the
default value for the field’s type.

```
struct StructDefault {
    a: i32,
    b: String,
}

impl Default for StructDefault {
    fn default() -> StructDefault {
        StructDefault{
            a: 100,
            b: "default".to_string(),
        }
    }
}
```

The code above will now return `100` for field `a` and `”default”` for
`b`, rather then `0` and `””` respectively.
2017-02-20 22:35:31 +01:00
David Tolnay
3bf8cda994
Update generics handling to use split_for_impl 2017-02-20 13:04:40 -08:00
David Tolnay
f98e7f6ba0 Merge pull request #778 from SimonSapin/serialize_display_bounded_length
Avoid some string allocations.
2017-02-20 11:09:32 -08:00
Simon Sapin
772b22b427 Avoid some string allocations. 2017-02-20 18:36:38 +01:00
David Tolnay
535ab1e04b
Merge pull request #771 from elliottslaughter:internally_content_tagged 2017-02-19 16:08:49 -08:00
David Tolnay
a3fe03c323
Serialization of Haskell style enums 2017-02-19 16:04:39 -08:00
David Tolnay
7dad6426da Merge pull request #774 from nox/limit-hints
Clamp hints coming from untrusted input to 4096
2017-02-19 13:51:21 -08:00
David Tolnay
792a5f7502
Also clamp the collection impls 2017-02-19 13:47:05 -08:00
Anthony Ramine
a4c738a9f3 Clamp hints coming from untrusted input to 4096 2017-02-19 14:29:41 +01:00
Elliott Slaughter
4538143d00 Initial work to support serialization of adjacently tagged enums. 2017-02-18 20:46:37 -08:00
David Tolnay
7f08894a32
Remove dependency on unneeded syn feature 2017-02-17 21:01:42 -08:00
David Tolnay
adf7b086b5
Remove outdated comment 2017-02-17 20:38:50 -08:00
David Tolnay
c590df13b9
Add compile-fail test for the with attribute 2017-02-16 18:43:04 -08:00
Oliver Schneider
afa6dfbbe2 Merge pull request #765 from serde-rs/with
Pair serialize_with and deserialize_with into one attribute
2017-02-15 08:33:14 +01:00
David Tolnay
f500db6e91
Pair serialize_with and deserialize_with into one attribute 2017-02-14 17:36:50 -08:00
David Tolnay
090c8a7049 Merge pull request #762 from serde-rs/rustfmt
Use rustfmt
2017-02-13 01:29:25 -08:00
David Tolnay
e8651a52e7
Rustfmt 2017-02-12 22:15:59 -08:00
David Tolnay
964a2dd4d1
Release 0.9.7 2017-02-09 17:52:11 -08:00
David Tolnay
8a21bbc720 Merge pull request #755 from serde-rs/playground
Playground feature to get serde_derive picked up by integer32 playground
2017-02-09 17:50:39 -08:00
Oliver Schneider
4dba260ad7 Merge pull request #756 from shepmaster/patch-2
Add missing close backtick
2017-02-09 18:01:35 +01:00
Jake Goulding
1d3044fa28 Add missing close backtick 2017-02-09 11:53:12 -05:00
David Tolnay
d1f0112bfb
Playground feature to get serde_derive picked up by integer32 playground 2017-02-08 12:37:40 -08:00
David Tolnay
3f25cd9a7e
No longer need ser::Error import 2017-02-08 08:17:43 -08:00
David Tolnay
45a36f1219
Fix proc macro panic message in tests 2017-02-08 08:12:32 -08:00
David Tolnay
529a1cfedb
Keyword no_std for serde and serde_derive 2017-02-08 07:40:02 -08:00
David Tolnay
219abd2e00
The performance is identical 2017-02-04 19:04:29 -08:00
David Tolnay
4bd10528a0 Merge pull request #736 from nox/serialize-iter
Introduce collect_seq and collect_map
2017-02-04 11:18:36 -08:00
David Tolnay
b82bba2d0a Merge pull request #747 from serde-rs/phantom_tags
Content clean-up
2017-02-04 08:53:04 -08:00