fish-lib 0.2.3

A work-in-progress fishing game library containing the game/storage logic for a discord fishing game I'm working on.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::collections::HashMap;
use std::sync::Arc;

pub trait IntoArcMap<K, V> {
    fn into_arc_map(self) -> HashMap<K, Arc<V>>;
}

impl<K, V> IntoArcMap<K, V> for HashMap<K, V>
where
    K: Eq + std::hash::Hash,
{
    fn into_arc_map(self) -> HashMap<K, Arc<V>> {
        self.into_iter().map(|(k, v)| (k, Arc::new(v))).collect()
    }
}