fn take(&mut self, name: &str, span: Span) -> CompileResult<Option<&Var>> {
        if let Some(var) = self.locals.get_mut(name) {
            if let Some(moved_at) = var.moved_at {
                return Err(CompileError::new(
                    span,
                    CompileErrorKind::VariableMoved { moved_at },
                ));
            }

            var.moved_at = Some(span);
            return Ok(Some(var));
        }

        Ok(None)
    }
/// Access the variable with the given name.
Access the variable with the given name.
Access the variable with the given name .
fn take(&mut self, name: &str, span: Span) -> CompileResult<Option<&Var>> {
        if let Some(var) = self.locals.get_mut(name) {
            if let Some(moved_at) = var.moved_at {
                return Err(CompileError::new(
                    span,
                    CompileErrorKind::VariableMoved { moved_at },
                ));
            }
            var.moved_at = Some(span);
            return Ok(Some(var));
        }
        Ok(None)
    }
fn take ( & mut self , name : & str , span : Span ) -> CompileResult < Option < & Var > > { if let Some ( var ) = self . locals . get_mut ( name ) { if let Some ( moved_at ) = var . moved_at { return Err ( CompileError :: new ( span , CompileErrorKind :: VariableMoved { moved_at } , ) ) ; } var . moved_at = Some ( span ) ; return Ok ( Some ( var ) ) ; } Ok ( None ) }
Access the variable with the given name.
Access the variable with the given name .
&mut self
name
&str
span
Span
&mut self
name
&str
span
Span