Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Remove lifetime specification from library
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueDoctor committed Apr 12, 2020
1 parent e03029d commit d712d46
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rask-engine/src/resources/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ pub struct ResourceTable(&'static mut [Resource]);

macro_rules! get_store {
($type: ty, $enum_type: ident) => {
impl<'a> GetStore<'a, $type> for ResourceTable {
unsafe fn get(&'a self, id: usize) -> Result<&'a $type, EngineError> {
impl GetStore<$type> for ResourceTable {
unsafe fn get(&self, id: usize) -> Result<&$type, EngineError> {
self.index_check(id)?;
match &self.0[id] {
Resource::$enum_type(value) => Ok(&value),
Expand All @@ -22,13 +22,13 @@ macro_rules! get_store {
};
}

pub trait GetStore<'a, T> {
pub trait GetStore<T> {
/// Retrieve a resource from the library.
///
/// # Safety
///
/// The function is not thread safe.
unsafe fn get(&'a self, id: usize) -> Result<&'a T, EngineError>;
unsafe fn get(&self, id: usize) -> Result<&T, EngineError>;
/// Store a resource to the library
///
/// # Safety
Expand Down

0 comments on commit d712d46

Please sign in to comment.