Small clean up
This commit is contained in:
@@ -2,6 +2,26 @@ use std::collections::HashMap;
|
||||
|
||||
use crate::item::Item;
|
||||
|
||||
/*
|
||||
pub trait Storage {
|
||||
type Key;
|
||||
|
||||
type IterKeys:
|
||||
type IterItems:
|
||||
type IterItemsMut:
|
||||
|
||||
fn contains_key(&self, key: Self::Key) -> bool;
|
||||
fn insert(&mut self, key: Self::Key, item: Item);
|
||||
fn get_id(&self, key: Self::Key) -> usize;
|
||||
fn get_item(&mut self, id: usize) -> &mut Item;
|
||||
fn item(&self, id: usize) -> &Item;
|
||||
fn item_mut(&mut self, id: usize) -> &mut Item;
|
||||
fn items(&self) -> impl Iterator<Item = &Item>;
|
||||
fn items_mut(&mut self) -> impl Iterator<Item = &mut Item>;
|
||||
fn keys(&self) -> impl Iterator<Item = &String>;
|
||||
}
|
||||
*/
|
||||
|
||||
pub struct Storage {
|
||||
keys: HashMap<String, usize>,
|
||||
items: Vec<Item>,
|
||||
|
||||
Reference in New Issue
Block a user