mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-10-26 21:39:53 +00:00
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
This commit is contained in:
1 parent
c488cec641
commit
bc946e4fd7
8 files changed
+222
-47
No files matched your search
@@ -0,0 +1,11 @@
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
|
||||
#[derive(Deserialize)] //~ ERROR: proc-macro derive panicked
|
||||
#[serde(from="")]
|
||||
enum TestOne {
|
||||
Testing,
|
||||
One,
|
||||
Two,
|
||||
Three,
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
|
||||
#[derive(Serialize)] //~ ERROR: proc-macro derive panicked
|
||||
#[serde(into="")]
|
||||
enum TestOne {
|
||||
Testing,
|
||||
One,
|
||||
Two,
|
||||
Three,
|
||||
}
|
||||
Reference in new issue
Block a user