Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
tgecho committed Dec 29, 2023
1 parent 48dda87 commit 026575b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions canrun/src/core/mkmvmap.rs
Expand Up @@ -6,17 +6,17 @@ use std::hash::Hash;
pub struct MKMVMap<K: Eq + Hash + Clone + fmt::Debug, V: Clone> {
current_id: usize,
keys: HashMap<K, HashSet<usize>>,
values: HashMap<usize, Value<K, V>>,
values: HashMap<usize, MKValue<K, V>>,
}

#[derive(Clone)]
pub(crate) struct Value<K, V> {
pub(crate) struct MKValue<K, V> {
id: usize,
pub keys: Vec<K>,
pub value: V,
}

impl<K: Eq, V: PartialEq> PartialEq for Value<K, V> {
impl<K: Eq, V: PartialEq> PartialEq for MKValue<K, V> {
fn eq(&self, other: &Self) -> bool {
self.id == other.id && self.keys == other.keys && self.value == other.value
}
Expand Down Expand Up @@ -48,7 +48,7 @@ impl<K: Eq + Hash + Clone + fmt::Debug, V: Clone> MKMVMap<K, V> {
key.clone(),
)
});
self.values = self.values.update(id, Value { id, keys, value });
self.values = self.values.update(id, MKValue { id, keys, value });
}

pub fn extract(&mut self, key: &K) -> Option<Vec<V>> {
Expand Down Expand Up @@ -90,7 +90,7 @@ impl<K: Eq + Hash + Clone + fmt::Debug, V: Clone> MKMVMap<K, V> {
}
}

impl<K: Eq + Hash + Clone + fmt::Debug, V> fmt::Debug for Value<K, V> {
impl<K: Eq + Hash + Clone + fmt::Debug, V> fmt::Debug for MKValue<K, V> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "Value {:?} {:?}", self.id, self.keys)
}
Expand Down

0 comments on commit 026575b

Please sign in to comment.