Moves a bunch of libraries to traits
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-12-24 12:00:50 +01:00
parent bce636b97e
commit 47df85e8d3
47 changed files with 730 additions and 358 deletions

View File

@@ -24,13 +24,13 @@ pub trait DataLibrary<T: ?Sized> {
}
/// Gets a value from the library.
fn get(&self, key: &StringKey) -> Option<&Arc<T>> {
self.map().get::<StringKey>(key)
fn get(&self, key: &StringKey) -> Option<Arc<T>> {
self.map().get::<StringKey>(key).cloned()
}
/// Gets a value from the library.
fn get_by_hash(&self, key: u32) -> Option<&Arc<T>> {
self.map().get::<u32>(&key)
fn get_by_hash(&self, key: u32) -> Option<Arc<T>> {
self.map().get::<u32>(&key).cloned()
}
/// Gets a value from the library by the index where it is stored.