Return none from depot get if stale id used

This commit is contained in:
Louis Pearson 2021-04-05 06:14:29 -06:00
parent d7ed57ca7e
commit 07341cc67f

View File

@ -94,7 +94,7 @@ impl<T> Depot<T> {
if entry.gen == id.gen {
entry.item.as_ref()
} else {
panic!("Stale ID used to access depot entry");
None
}
} else {
None
@ -106,7 +106,7 @@ impl<T> Depot<T> {
if entry.gen == id.gen {
entry.item.as_mut()
} else {
panic!("Stale ID used to access depot entry");
None
}
} else {
None