Michael Smith
9fc180e62f
Implement deserialize_with for variants
...
Complements variant serialize_with and closes #1013 .
2017-08-14 14:41:05 -07:00
Michael Smith
5b815b7001
Implement serialize_with for variants
...
As discussed in #1013 , serialize_with functions attached to variants receive an
argument for each inner value contained within the variant. Internally such a
function is wired up to the serializer as if the variant were a newtype variant.
2017-08-14 11:17:08 -07:00
David Tolnay
4831482695
Doc comment on statement is not used by rustdoc
...
Fixes #1014 .
2017-08-05 23:35:14 -07:00
David Tolnay
26098ed877
Release 1.0.11
2017-07-27 00:56:28 -07:00
David Tolnay
f36a1e0895
Inherit the visibility of remote struct definition
2017-07-25 23:52:06 -07:00
David Tolnay
83537c95e1
Release 1.0.10
2017-07-11 21:19:24 -07:00
David Tolnay
9ecb0839de
Release 1.0.9
2017-06-29 20:21:29 -07:00
David Tolnay
1d3e921ba6
Fix deserializer bounds on remote derive
2017-06-29 20:12:44 -07:00
Steven Fackler
8e8694261b
Fix identifier deserialization from non-u32
...
Closes #962
2017-06-19 20:23:14 -07:00
David Tolnay
4fdba725fe
Revert "Support deserialization of struct keys from integers"
...
This is not as useful as expected because the Serializer does not know the real
index of each struct field being serialized. The best it can do is keep a
counter, which goes wrong if fields are conditionally skipped.
This reverts commit eec7101894
.
2017-06-18 09:11:21 -07:00
Steven Fackler
eec7101894
Support deserialization of struct keys from integers
...
serde-cbor supports a "packed" serialization flag which causes keys to
be serialized as their indices, but the deserializer currently has to
hardcode support for this format. We can simply support deserialization
of struct keys from integers as we already do for enum variants.
2017-06-17 18:12:07 -07:00
David Tolnay
fd3d1396d3
Release 1.0.8
2017-05-24 00:17:27 -07:00
David Tolnay
c47b4c8e0b
Release 1.0.7
2017-05-19 17:00:31 -07:00
David Tolnay
3d7aad1e7b
Release 1.0.6
2017-05-17 08:20:54 -07:00
David Tolnay
4d5e450054
Release 1.0.5
2017-05-14 12:53:48 -07:00
David Tolnay
c68b959696
Release 1.0.4
2017-05-10 20:05:22 -07:00
David Tolnay
58e30eaee4
Release 1.0.3
2017-05-10 10:15:39 -07:00
David Tolnay
8fafc7420c
Release 1.0.2
2017-04-27 12:32:30 -07:00
David Tolnay
bea1c5b0f5
Remove trailing whitespace
2017-04-27 12:31:13 -07:00
Ted Driggs
2440b59aae
Address feedback on PR #905
...
* Added error test when deny_unknown_fields enabled
* Fixed next_relevant_key to use absolute paths
2017-04-27 12:21:32 -07:00
Ted Driggs
873cfbe9ab
Fix #816 - adjacently-tagged enums honor deny_unknown_fields
2017-04-27 11:24:09 -07:00
David Tolnay
c7901e532e
Release 1.0.1
2017-04-23 16:40:56 -07:00
David Tolnay
d7ccef0cac
Release 1.0.0
2017-04-20 08:19:31 -07:00
David Tolnay
2d465415c5
Take credit
2017-04-20 08:13:46 -07:00
David Tolnay
bc2d637112
Cut an internals release
2017-04-20 08:11:31 -07:00
David Tolnay
cf1cdadc77
Fix some rustfmt screwups
2017-04-19 15:56:22 -07:00
David Tolnay
d1253cb193
Minimal serde_derive documentation
...
Fixes #886 .
2017-04-19 14:43:53 -07:00
David Tolnay
0240814677
Update post-merge html_root_urls
2017-04-19 14:32:04 -07:00
David Tolnay
7a7d4c6364
Format in rfc style
2017-04-18 14:23:21 -07:00
David Tolnay
6279b0d930
Resolve merge conflicts
2017-04-17 14:25:29 -07:00
David Tolnay
a778425d0f
Merge branch 'origin/master' into 'origin/1.0'
...
Conflicts:
serde/Cargo.toml
serde/src/de/impls.rs
serde/src/ser/impls.rs
serde_derive/Cargo.toml
serde_test/Cargo.toml
2017-04-17 14:18:33 -07:00
David Tolnay
d4d2061a2e
Release 0.9.14
2017-04-17 07:33:45 -07:00
David Tolnay
c13a37d4db
Rename VariantAccess methods to not conflict with Deserializer
2017-04-15 12:35:04 -07:00
David Tolnay
cdfd445528
Generate deserialize impls for identifiers
2017-04-14 21:53:48 -07:00
David Tolnay
f9535a4d67
Remove "item" terminology in favor of "container"
...
The docs have been using "container" for a long time.
2017-04-14 15:52:58 -07:00
David Tolnay
6d55501dab
Replace "codegen" with "derive"
2017-04-14 15:42:27 -07:00
David Tolnay
e77e7c4bba
Rename Deserializer::deserialize to deserialize_any
2017-04-14 12:52:57 -07:00
David Tolnay
31cec05712
Access traits
2017-04-14 12:24:35 -07:00
David Tolnay
3f920f645c
License boilerplate
2017-04-13 17:34:42 -07:00
David Tolnay
ea8fb97beb
Format in rfc style
2017-04-13 12:32:29 -07:00
David Tolnay
78407e19a9
Export Formatter directly for generated code
2017-04-13 12:02:16 -07:00
David Tolnay
dc7ab2696a
Point html_root_url to docs.rs
2017-04-13 11:31:29 -07:00
David Tolnay
4f39766211
Fix paths to readme files
2017-04-13 10:37:24 -07:00
David Tolnay
0b7accf86c
Remove unused unstable flag from serde_derive
2017-04-10 17:29:59 -07:00
David Tolnay
1985cfc955
Merge branch 'origin/1.0' into 'origin/identifier'
...
Conflicts:
serde_derive/src/ser.rs
2017-04-10 12:37:41 -07:00
David Tolnay
2deacf8eaa
Detect incorrect remote type without getter
2017-04-10 12:12:00 -07:00
David Tolnay
52e93150e6
Standardize on u32 as the type of a variant index
2017-04-09 14:03:18 -07:00
David Tolnay
a38b24136b
Rename deserialize_struct_field to deserialize_identifier
...
Because it applies to both struct fields and discriminants of an enum.
2017-04-09 13:35:22 -07:00
David Tolnay
78f682590a
Merge branch 'origin/1.0' into 'origin/remote'
...
Conflicts:
serde_derive/src/de.rs
2017-04-09 13:19:04 -07:00
David Tolnay
1986c17052
Remove conversion from empty seq to unit struct
2017-04-09 13:08:05 -07:00
David Tolnay
9d8987bde8
Require getters to return the correct type
2017-04-09 10:59:54 -07:00
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
8fd41d3b28
Disable publishing
2017-04-05 15:11:47 -07:00
David Tolnay
a7f6ad137a
Merge branch 'master' into '1.0'
...
Conflicts:
serde/src/macros.rs
2017-04-05 15:10:18 -07:00
David Tolnay
1b763da529
Release 0.9.13
2017-04-05 15:03:37 -07:00
David Tolnay
732b91e53d
Make the built-in visitors private
2017-04-04 18:59:57 -07:00
David Tolnay
fb48111e46
Derive for borrowed fields
2017-04-03 00:40:45 -07:00
David Tolnay
d3a2f5e268
Add a 'de lifetime to the deserialize traits
2017-03-29 00:10:34 -07:00
David Tolnay
59b3961ad4
Release 0.9.12
2017-03-27 15:45:14 -07:00
David Tolnay
08e2182042
UFCS for Option::map and Result::map
2017-03-18 13:31:03 -07:00
David Tolnay
8c7396c35a
Be consistent with UFCS and double underscores
2017-03-18 10:33:22 -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
dc9445f873
Release 0.9.11
2017-03-05 16:51:44 -08:00
David Tolnay
51ed9c2a40
Release 0.9.10
2017-02-28 12:45:39 -08:00
David Tolnay
59ec931d8f
Release 0.9.9
2017-02-24 13:57:52 -08: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
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
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
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
adf7b086b5
Remove outdated comment
2017-02-17 20:38:50 -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
529a1cfedb
Keyword no_std for serde and serde_derive
2017-02-08 07:40:02 -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
Oliver Schneider
393b19ee8a
update codegen to the content changes
2017-02-04 10:37:50 +01: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
a55d812441
Even more absolute paths
2017-02-01 12:12:39 -08:00
David Tolnay
b7ca574bb3
Use absolute paths to Ok and Err
2017-02-01 09:42:12 -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
297f373548
Release 0.9.4
2017-01-30 17:42:11 -08:00
David Tolnay
8624ca6f1d
Release 0.9.3
2017-01-28 15:01:58 -08:00
David Tolnay
c31f76321c
Release 0.9.2
2017-01-28 09:10:39 -08:00
David Tolnay
c52e131a03
Replace deprecated MacroInput
2017-01-27 15:42:43 -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
3e1e42ef9b
Combine the test suites
2017-01-25 20:29:09 -08:00
David Tolnay
e0d6b9d010
Merge serde_codegen into serde_derive crate
2017-01-25 20:07:55 -08:00
David Tolnay
a5b8e806f8
Remove with-syntex feature of serde_codegen
2017-01-25 20:02:24 -08:00
David Tolnay
7612fd8e82
Release 0.9.1
2017-01-25 14:58:22 -08:00
David Tolnay
4c77af53e5
Clean up dependency declarations
2017-01-25 14:54:32 -08:00
David Tolnay
5d9c1aeb06
Release 0.9.0
2017-01-25 12:57:45 -08:00
David Tolnay
59e48997dd
Release 0.9.0-rc4
2017-01-25 10:14:43 -08:00
Oliver Schneider
b105423e5e
add travis badge to crates.io
2017-01-24 10:30:10 +01:00
David Tolnay
c334c1c7b5
Release 0.9.0-rc3
2017-01-23 19:14:02 -08:00
David Tolnay
fc4e370ba9
Support serde_derive on no_std
2017-01-23 16:03:06 -08:00
David Tolnay
1e05fc2145
Release 0.9.0-rc2
2017-01-21 16:30:13 -08:00
David Tolnay
3a52364f3e
Release 0.9.0-rc1
2017-01-15 09:26:44 -08:00
David Tolnay
8242c64152
Merge branch v0.8 into master
2017-01-10 17:16:31 -08:00
David Tolnay
9e45bd8c87
Release 0.8.22
2017-01-10 17:10:26 -08:00
David Tolnay
ad34c14c8c
Prepare for 0.9 breaking changes
2017-01-08 00:18:53 -08:00
David Tolnay
894a21bc1f
Remove the proc_macro feature gate
2017-01-08 00:11:11 -08:00
David Tolnay
9338c4f1b9
Release 0.8.21
2016-12-24 13:10:24 -05:00
David Tolnay
36f07912b8
Remove no-longer-necessary cfg
...
This was fixed in Rust, allowing proc macro crates to be tested.
2016-12-17 17:32:11 -08:00
David Tolnay
08c59a2e0e
Release 0.8.20
2016-12-16 07:58:52 -08:00
David Tolnay
36641e7b81
Release 0.8.19
2016-11-23 09:14:03 -08:00
David Tolnay
17fb4cb503
Release 0.8.18
2016-11-19 11:40:00 -08:00
David Tolnay
a16f07858b
Ask proc_macro_derive to ignore serde attributes
2016-11-15 21:29:34 -05:00
David Tolnay
133d117bf4
Bump post-expansion dependency
2016-11-07 11:16:14 -08:00
David Tolnay
c91fca19e1
Release 0.8.17
2016-11-02 09:26:04 -07:00
David Tolnay
c9612a2f57
Release 0.8.16
2016-10-22 00:07:27 -07:00
David Tolnay
9acb17ab54
Release 0.8.15
2016-10-20 08:42:40 -07:00
David Tolnay
49aca521f1
Bump post-expansion dependency
2016-10-20 00:01:14 -07:00
David Tolnay
4c38bd0180
Merge branch origin/master into origin/post
2016-10-19 23:59:53 -07:00
David Tolnay
1b42f3f594
Release 0.8.14
2016-10-18 21:42:39 -07:00
David Tolnay
a9b6cbb8b3
Use post-expansion crate to let other custom derives see serde attrs
2016-10-18 09:00:33 -07:00
David Tolnay
532b950971
Release 0.8.13
2016-10-16 10:34:26 -07:00
Erick Tryzelaar
f93b4e91e6
Version bump serde_derive to 0.8.13
2016-10-15 15:24:37 -07:00
Erick Tryzelaar
4919a3184d
Update syntex version to 0.45.0
2016-10-15 14:01:14 -07:00
David Tolnay
85c95040b3
Release 0.8.12
2016-10-08 15:38:29 -07:00
David Tolnay
339c0f5493
Remove unneeded test feature
2016-10-08 15:36:46 -07:00
Mark Roghelia
ef5d09e144
Rename rustc_macro to proc_macro
...
Fixes #575
2016-10-08 18:29:36 -04:00
David Tolnay
c61b20cceb
Release 0.8.11
2016-10-03 13:38:52 -07:00
David Tolnay
b27039d34d
Compiletest error messages
2016-09-28 12:46:54 -07:00
David Tolnay
1b6fd5a362
Delete serde_macros
2016-09-28 11:59:25 -07:00
David Tolnay
2a2c098eeb
Release 0.8.10
2016-09-28 09:56:15 -07:00
David Tolnay
0c18c151e2
Revamp serde_codegen_internals error handling
2016-09-27 00:11:37 -07:00
David Tolnay
51f95575ec
Merge branch origin/master into origin/syn
...
Conflicts:
serde_codegen/Cargo.toml
serde_codegen_internals/Cargo.toml
serde_derive/Cargo.toml
2016-09-24 09:29:21 -07:00
Oliver Schneider
429de89276
Release 0.8.9
2016-09-23 07:11:59 -07:00
David Tolnay
c34baa1e5f
No more syntex for serde_derive
2016-09-11 19:55:13 -07:00
David Tolnay
7cc36a9cd3
Release 0.8.8
2016-09-08 08:34:20 -07:00
David Tolnay
e85ca8411e
Release 0.8.7
2016-09-05 09:39:27 -07:00
David Tolnay
248d937f9a
Release 0.8.6
2016-09-01 22:06:27 -07:00
David Tolnay
ac1128a647
Update serde_derive to 0.8.5
2016-09-01 21:28:58 -07:00
David Tolnay
88d845c4d1
Include! test suite for serde_derive
2016-09-01 21:28:40 -07:00
David Tolnay
54cee86fd3
Bump to 0.8.5
2016-08-31 20:14:44 -07:00
David Tolnay
3c45e5c7a5
Next iteration
2016-08-30 23:55:08 -07:00
David Tolnay
d914fdf67b
Macros 1.1
2016-08-28 22:21:25 -07:00