From a20bcfed7d3b6aacc3211514d9804651a458e725 Mon Sep 17 00:00:00 2001 From: troido Date: Sun, 27 Sep 2020 15:33:09 +0200 Subject: 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} --- src/item.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/item.rs') 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 { - Ok(Self(s.to_string())) - } -} - #[derive(Debug, Clone)] pub struct Item { pub ent: Template, -- cgit