mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-21 21:25:16 +00:00
Support setting referent properties via attributes (#843)
Co-authored-by: Kenneth Loeffler <kenloef@gmail.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use std::{
|
||||
borrow::Borrow,
|
||||
collections::HashMap,
|
||||
collections::{hash_map, HashMap},
|
||||
fmt::{self, Debug},
|
||||
hash::Hash,
|
||||
};
|
||||
@@ -71,3 +71,33 @@ impl<K: Hash + Eq, V: Eq> PartialEq for MultiMap<K, V> {
|
||||
self.inner == other.inner
|
||||
}
|
||||
}
|
||||
|
||||
impl<K, V> Default for MultiMap<K, V> {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
inner: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<K: Hash + Eq, V: Eq> IntoIterator for MultiMap<K, V> {
|
||||
type IntoIter = MultiMapIntoIter<K, V>;
|
||||
type Item = (K, Vec<V>);
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
Self::IntoIter {
|
||||
inner: self.inner.into_iter(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct MultiMapIntoIter<K: Hash + Eq, V: Eq> {
|
||||
inner: hash_map::IntoIter<K, Vec<V>>,
|
||||
}
|
||||
|
||||
impl<K: Hash + Eq, V: Eq> Iterator for MultiMapIntoIter<K, V> {
|
||||
type Item = (K, Vec<V>);
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
self.inner.next()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user