-
-
Notifications
You must be signed in to change notification settings - Fork 774
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
59 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
[workspace] | ||
members = [ | ||
"serde", | ||
"serde_derive", | ||
"serde_derive_internals", | ||
"serde_test", | ||
"test_suite", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.wasm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "wa-serde-derive" | ||
version = "0.1.137" | ||
authors = ["David Tolnay <[email protected]>"] | ||
license = "MIT OR Apache-2.0" | ||
description = "serde_derive compiled to wasm" | ||
repository = "https://github.com/dtolnay/watt" | ||
include = ["src"] | ||
|
||
[lib] | ||
proc-macro = true | ||
|
||
[dependencies] | ||
watt = "0.4" | ||
|
||
[workspace] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
extern crate proc_macro; | ||
extern crate watt; | ||
|
||
use proc_macro::TokenStream; | ||
use watt::WasmMacro; | ||
|
||
static MACRO: WasmMacro = WasmMacro::new(WASM); | ||
static WASM: &[u8] = include_bytes!("serde_derive.wasm"); | ||
|
||
#[proc_macro_derive(Serialize, attributes(serde))] | ||
pub fn derive_serialize(input: TokenStream) -> TokenStream { | ||
MACRO.proc_macro_derive("derive_serialize", input) | ||
} | ||
|
||
#[proc_macro_derive(Deserialize, attributes(serde))] | ||
pub fn derive_deserialize(input: TokenStream) -> TokenStream { | ||
MACRO.proc_macro_derive("derive_deserialize", input) | ||
} |