| 64 | // impl Serializer for TodoItem {} |
| 65 | |
| 66 | pub trait Serializer |
| 67 | where |
| 68 | Self: Sized + Serialize + for<'a> Deserialize<'a>, |
| 69 | { |
| 70 | fn serialize(&self) -> String { |
| 71 | serde_json::to_string(self).unwrap() |
| 72 | } |
| 73 | |
| 74 | fn deserialize<S: Into<String>>(s: S) -> Self { |
| 75 | serde_json::from_str(&s.into()).unwrap() |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | impl Serializer for TodoItem {} |
| 80 |
no outgoing calls
no test coverage detected