Commit Graph

74 Commits

Author SHA1 Message Date
David Tolnay
a6d172111b
Derive for remote types 2017-04-09 10:15:46 -07:00
David Tolnay
726eea9a97
Separate out the private functionality
This makes it easier when clicking through [src] links from rustdoc, not having
to sift through public and internal code combined together.
2017-04-07 09:46:48 -07:00
David Tolnay
dd62801b22
Use spaces around =-sign like Rust does 2017-04-06 14:22:03 -07:00
David Tolnay
fb48111e46
Derive for borrowed fields 2017-04-03 00:40:45 -07:00
David Tolnay
59b3961ad4
Release 0.9.12 2017-03-27 15:45:14 -07:00
David Tolnay
42b2fd8eec
Improve error message parsing from and into 2017-03-18 09:22:44 -07:00
John Baublitz
bc946e4fd7 Macro attributes to specify From and Into trait types for structs and enums (#817)
* serde macro support for type conversions through From and Into trait

* Revisions requested by dtolnay

* Additional changes requested by dtolnay
2017-03-18 09:22:27 -07:00
David Tolnay
51ed9c2a40
Release 0.9.10 2017-02-28 12:45:39 -08:00
David Tolnay
47efbc6d75
Don't need to pass back the input here 2017-02-25 11:32:27 -08:00
David Tolnay
17279e8a4f
Simplify case conversion implementation 2017-02-25 11:32:22 -08:00
David Tolnay
06c631db05
Bring in the tests 2017-02-25 11:02:51 -08:00
David Tolnay
7952bad41f
Move case conversion to its own file 2017-02-25 11:02:25 -08:00
Michael Mokrysz
3308f81c3a Saving progress on naming convention conversion code to try new Inflector changes. #788 2017-02-25 13:24:49 +00:00
Michael Mokrysz
84915268ee Minor fixes for pull request. Cheers @dtolnay. 2017-02-24 01:55:31 +00:00
Michael Mokrysz
3b59d47e07 Heavily refactored rename_all and switched to SCREAMING_SNAKE_CASE. 2017-02-23 23:22:54 +00:00
Michael Mokrysz
fc94c5399a Implementing rename_all container attribute using Inflector trait. #140 2017-02-23 18:58:41 +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
3d6e086d3e
Support custom paths in container attribute serde(default="...") 2017-02-20 17:06:00 -08:00
Thomas de Zeeuw
7bee779514 Only allow #[serde(default)]` on structs 2017-02-21 00:15:00 +01: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
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
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
f500db6e91
Pair serialize_with and deserialize_with into one attribute 2017-02-14 17:36:50 -08:00
David Tolnay
e8651a52e7
Rustfmt 2017-02-12 22:15:59 -08:00
David Tolnay
d1306a78ec
Release 0.9.6 2017-02-03 08:02:47 -08:00
David Tolnay
ff21d557c7
Untagged and internally tagged enums 2017-02-02 18:48:30 -08:00
David Tolnay
d960571439
Release 0.9.5 2017-02-01 01:01:06 -08:00
Oliver Schneider
368784949e move to cargo clippy instead of using the clippy plugin (#733)
* move to cargo clippy instead of using the clippy plugin

fixes #729

* non-exectable scripts must be run with `sh`

* don't build serde in the clippy travis job

* only run clippy tests if installing clippy succeeds

* why is travis so picky?

* no more serde_codegen

* serde_test_suite_deps has no features

* don't use empty loops, llvm optimizes them to undefined behaviour

* abort the clippy job when clippy lints are triggered

* use caches on travis to speed up builds

* why are we even using `travis-cargo`?

* need to reinstall clippy frequently due to nightly updates

* command line tools are hard
2017-01-31 09:09:37 -08:00
David Tolnay
c31f76321c
Release 0.9.2 2017-01-28 09:10:39 -08:00
David Tolnay
c0a06bdc96
Update to syn 0.11 2017-01-27 15:25:42 -08:00
David Tolnay
e4f7d8513c
Clean up clippy lints in codegen_internals 2017-01-25 21:22:15 -08:00
David Tolnay
4c77af53e5
Clean up dependency declarations 2017-01-25 14:54:32 -08:00
Oliver Schneider
b105423e5e add travis badge to crates.io 2017-01-24 10:30:10 +01:00
David Tolnay
3a52364f3e
Release 0.9.0-rc1 2017-01-15 09:26:44 -08:00
David Tolnay
ad34c14c8c
Prepare for 0.9 breaking changes 2017-01-08 00:18:53 -08:00
David Tolnay
9338c4f1b9
Release 0.8.21 2016-12-24 13:10:24 -05:00
Shing Lyu
2fea8c9c28 Implement skip_serializing for enum variant 2016-12-24 22:34:22 +08:00
David Tolnay
08c59a2e0e
Release 0.8.20 2016-12-16 07:58:52 -08:00
Shing Lyu
95ffca9bbe Implemented skip_deserializing for enum 2016-12-16 20:29:21 +08:00
David Tolnay
8dba87661b
Bump serde_codegen_internals because it failed to publish somehow 2016-11-19 11:47:19 -08:00
David Tolnay
17fb4cb503
Release 0.8.18 2016-11-19 11:40:00 -08:00
David Tolnay
f8c3d225a3
Shorten the syn meta item matches 2016-11-02 22:56:27 -07:00
David Tolnay
6d40d9e8ec
Update codegen internals to syn 0.10 2016-11-02 22:52:20 -07:00
David Tolnay
85c95040b3
Release 0.8.12 2016-10-08 15:38:29 -07:00
David Tolnay
b4d5c26f4e
Update to latest syn and quote 2016-10-08 15:36:02 -07:00
David Tolnay
2a2c098eeb
Release 0.8.10 2016-09-28 09:56:15 -07:00
David Tolnay
effa298871
Fix differences in the generated code 2016-09-27 09:56:35 -07:00