From fd0bd24fa4e98b3bcd95a14ff844411727fb4433 Mon Sep 17 00:00:00 2001 From: troido Date: Fri, 3 Apr 2020 18:26:38 +0200 Subject: added command line options --- src/components/equipment.rs | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'src/components') diff --git a/src/components/equipment.rs b/src/components/equipment.rs index c19563f..8f7b9ab 100644 --- a/src/components/equipment.rs +++ b/src/components/equipment.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use serde_json::{json, Value}; +use serde_json::Value; use specs::{ Component, HashMapStorage @@ -21,12 +21,6 @@ impl Slot { _ => None } } - pub fn to_string(&self) -> String { - match self { - Self::Hand => "hand", - Self::Body => "body" - }.to_string() - } } @@ -44,12 +38,6 @@ impl Stat { _ => None } } - pub fn to_string(&self) -> String { - match self { - Self::Strength => "strength", - Self::Defence => "defence" - }.to_string() - } } @@ -73,12 +61,6 @@ impl Equippable { .collect::>>()? }) } - pub fn to_json(&self) -> Value { - json!({ - "slot": self.slot.to_string(), - "stats": self.stats.iter().map(|(k, v)| (k.to_string(), *v)).collect::>() - }) - } } -- cgit