summaryrefslogtreecommitdiff
path: root/src/item.rs
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2019-02-03 05:45:35 -0600
committertom barrett <spalf0@gmail.com>2019-02-03 05:45:35 -0600
commit46fa862e04bc43311ba79ef3db70abf9014b9104 (patch)
tree3507873ec788af1f1e0885bbb676dbb4a373d48e /src/item.rs
parent828f0d83dcb258a8e5efd55a7775592c6e5f77bc (diff)
bringing to 2018
Diffstat (limited to 'src/item.rs')
-rw-r--r--src/item.rs17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/item.rs b/src/item.rs
index af5c2f8..c51b1a2 100644
--- a/src/item.rs
+++ b/src/item.rs
@@ -1,23 +1,18 @@
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Item {
- pub name : String,
- pub size : usize,
+ pub name: String,
+ pub size: usize,
}
impl Item {
- pub fn new(name : &str, size : usize) -> Item {
+ pub fn new(name: &str, size: usize) -> Item {
Item {
- name : String::from(name),
- size : size,
+ name: String::from(name),
+ size,
}
}
pub fn is_mineral(&self) -> bool {
- if self.name == "Mineral" {
- true
- }
- else {
- false
- }
+ self.name == "Mineral"
}
}