Feat: abstraction lifetimes work out nicely

This commit is contained in:
Jonathan Kelley committed 2021-05-16 02:58:57 -04:00
1 parent a99147c85b
commit 2284b35782
2 files changed
+46 -42

No files matched your search

+3 -3
View File
@@ -22,11 +22,11 @@ impl ScopeArena {
}
}
pub fn get(&self, idx: ScopeIdx) -> Result<&Scope> {
pub fn try_get(&self, idx: ScopeIdx) -> Result<&Scope> {
todo!()
}
pub fn get_mut(&self, idx: ScopeIdx) -> Result<&Scope> {
pub fn try_get_mut(&self, idx: ScopeIdx) -> Result<&mut Scope> {
todo!()
}
@@ -38,7 +38,7 @@ impl ScopeArena {
todo!()
}
pub fn with<T>(&mut self, f: impl FnOnce(&mut Arena<Scope>) -> T) -> T {
pub fn with<T>(&self, f: impl FnOnce(&mut Arena<Scope>) -> T) -> Result<T> {
todo!()
}