diff options
author | iximeow <me@iximeow.net> | 2019-04-21 14:17:39 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2020-01-12 17:14:56 -0800 |
commit | 9685d26ebe2982866c46531dddb36781eecc512f (patch) | |
tree | bd08ad693f361258ad73d85697401016a2efbaa2 | |
parent | c564c589c6b65993e5596d7d94a3fae0e7fe5f16 (diff) |
awful tweaks to expose a serde flag on yaxpeax-arch which will trickle through everything
-rw-r--r-- | Cargo.toml | 7 | ||||
-rw-r--r-- | src/lib.rs | 13 |
2 files changed, 20 insertions, 0 deletions
@@ -12,7 +12,14 @@ A rust pic17 decoder [dependencies] yaxpeax-arch = { path = "../../yaxpeax-arch" } "termion" = "1.4.0" +"serde" = "*" +"serde_derive" = "*" [[test]] name = "test" path = "test/test.rs" + +[features] +default = [] + +use-serde = [] @@ -1,3 +1,10 @@ +#[cfg(feature="use-serde")] +#[macro_use] extern crate serde_derive; +#[cfg(feature="use-serde")] +extern crate serde; +#[cfg(feature="use-serde")] +use serde::{Serialize, Deserialize}; + extern crate yaxpeax_arch; extern crate termion; @@ -13,8 +20,14 @@ pub struct Instruction { pub operands: [Operand; 2] } +#[cfg(feature="use-serde")] +#[derive(Debug, Serialize, Deserialize)] +pub struct PIC17; + +#[cfg(not(feature="use-serde"))] #[derive(Debug)] pub struct PIC17; + impl Arch for PIC17 { type Address = u16; type Instruction = Instruction; |