diff options
| author | troido <troido@protonmail.com> | 2020-09-27 15:33:09 +0200 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-09-27 15:33:09 +0200 |
| commit | a20bcfed7d3b6aacc3211514d9804651a458e725 (patch) | |
| tree | d4d4aaab553a3a9065e9dba8ef4fdec9ccf45778 /src/item.rs | |
| parent | c3a282d04f1fd5c7cc4cf5ebb478129c2b1c42fa (diff) | |
better serialisation structure for encyclopediae
["list", [1, 2, 3]] is now just [1, 2, 3] and {"type": builtwall", "kwargs": {"health": 50}} is now {":template": "builtwall", "health": 50}
Diffstat (limited to 'src/item.rs')
| -rw-r--r-- | src/item.rs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/item.rs b/src/item.rs index 37ee4f2..c8337f9 100644 --- a/src/item.rs +++ b/src/item.rs @@ -1,7 +1,6 @@ use std::collections::HashSet; -use std::str::FromStr; use serde; use serde::{Deserialize, Serialize}; use crate::{ @@ -9,8 +8,7 @@ use crate::{ components::{ Flag, equipment::Equippable - }, - errors::{ParseError} + } }; @@ -18,13 +16,6 @@ use crate::{ #[derive(Debug, Default, PartialEq, Eq, Clone, Hash, Serialize, Deserialize)] pub struct ItemId(pub String); -impl FromStr for ItemId { - type Err = ParseError; - fn from_str(s: &str) -> Result<Self, Self::Err> { - Ok(Self(s.to_string())) - } -} - #[derive(Debug, Clone)] pub struct Item { pub ent: Template, |
