Expose Vec::get() in EntityMap.

This commit is contained in:
Jakob Stoklund Olesen
2016-09-21 16:53:03 -07:00
parent 16dba4d35b
commit 4e09b48dd4

View File

@@ -70,6 +70,11 @@ impl<K, V> EntityMap<K, V>
k.index() < self.elems.len()
}
/// Get the element at `k` if it exists.
pub fn get(&self, k: K) -> Option<&V> {
self.elems.get(k.index())
}
/// Is this map completely empty?
pub fn is_empty(&self) -> bool {
self.elems.is_empty()