From c14dcf1998f5ba1ffea813da4f793fc3bde8c2b7 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Mon, 26 Feb 2018 08:51:08 -0600 Subject: -figured out way to deserialize using serde_erased --- src/astroid.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/astroid.rs') diff --git a/src/astroid.rs b/src/astroid.rs index 0eed4ff..6aa1807 100644 --- a/src/astroid.rs +++ b/src/astroid.rs @@ -1,9 +1,10 @@ -use mass::Mass; +use mass::{Mass, Type}; extern crate serde_json; #[derive(Serialize, Deserialize, Debug)] pub struct Astroid { name : String, + t : Type, location : (f64, f64, f64), } @@ -11,6 +12,7 @@ impl Mass for Astroid { fn new(name : &str, location : (f64, f64, f64)) -> Astroid { Astroid { name : String::from(name), + t : Type::Astroid, location : location, } } @@ -30,7 +32,4 @@ impl Mass for Astroid { fn serialize(&self) ->String { serde_json::to_string(self).unwrap() } - - fn deserialize(&mut self, data : &str) { - } } -- cgit v1.2.3