mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Remove scope.get
This commit is contained in:
parent
bbef63f28f
commit
4d65db22d2
2 changed files with 6 additions and 13 deletions
|
@ -20,12 +20,8 @@ pub(crate) struct Scope<'a, 'ctx> {
|
|||
pub(crate) struct JoinPointNotFound;
|
||||
|
||||
impl<'a, 'ctx> Scope<'a, 'ctx> {
|
||||
pub fn get(&self, symbol: &Symbol) -> Option<&(InLayout<'a>, BasicValueEnum<'ctx>)> {
|
||||
self.symbols.get(symbol)
|
||||
}
|
||||
|
||||
pub fn load_symbol(&self, symbol: &Symbol) -> BasicValueEnum<'ctx> {
|
||||
match self.get(symbol) {
|
||||
match self.symbols.get(symbol) {
|
||||
Some((_, ptr)) => *ptr,
|
||||
|
||||
None => panic!(
|
||||
|
@ -39,7 +35,7 @@ impl<'a, 'ctx> Scope<'a, 'ctx> {
|
|||
&self,
|
||||
symbol: &Symbol,
|
||||
) -> (BasicValueEnum<'ctx>, InLayout<'a>) {
|
||||
match self.get(symbol) {
|
||||
match self.symbols.get(symbol) {
|
||||
Some((layout, ptr)) => (*ptr, *layout),
|
||||
None => panic!("There was no entry for {:?} in scope {:?}", symbol, self),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue