// If the local name cannot be found, no instructions are emitted and None is returned
If the local name cannot be found, no instructions are emitted and None is returned
If the local name cannot be found no instructions are emitted and None is returned
fn try_emit_load_local(&mut self, symbol: Option<&DebugSymbol>, name: &LocalName) -> Option<u16> {
        if let Some(index) = self.scopes().resolve_local(name).map(|local| local.index()) {
            if let Ok(index) = u8::try_from(index) {
                self.emit_instr_byte(symbol, OpCode::LoadLocal, index);
            } else {
                self.emit_instr_data(symbol, OpCode::LoadLocal16, &index.to_le_bytes());
            }
            Some(index)
        } else{
            None
        }
    }
fn try_emit_load_local ( & mut self , symbol : Option < & DebugSymbol > , name : & LocalName ) -> Option < u16 > { if let Some ( index ) = self . scopes ( ) . resolve_local ( name ) . map ( | local | local . index ( ) ) { if let Ok ( index ) = u8 :: try_from ( index ) { self . emit_instr_byte ( symbol , OpCode :: LoadLocal , index ) ; } else { self . emit_instr_data ( symbol , OpCode :: LoadLocal16 , & index . to_le_bytes ( ) ) ; } Some ( index ) } else { None } }
If the local name cannot be found, no instructions are emitted and None is returned
If the local name cannot be found no instructions are emitted and None is returned
&mut self
symbol
Option<&DebugSymbol>
name
&LocalName