pub fn load_current_index_checked(
    instruction_sysvar_account_info: &AccountInfo,
) -> Result<u16, ProgramError> {
    if !check_id(instruction_sysvar_account_info.key) {
        return Err(ProgramError::UnsupportedSysvar);
    }

    let instruction_sysvar = instruction_sysvar_account_info.try_borrow_data()?;
    let mut instr_fixed_data = [0u8; 2];
    let len = instruction_sysvar.len();
    instr_fixed_data.copy_from_slice(&instruction_sysvar[len - 2..len]);
    Ok(u16::from_le_bytes(instr_fixed_data))
}
/// Load the current `Instruction`'s index in the currently executing
/// `Transaction`
Load the current `Instruction`'s index in the currently executing
`Transaction`
Load the current ` Instruction ` ' s index in the currently executing ` Transaction `
pub fn load_current_index_checked(
    instruction_sysvar_account_info: &AccountInfo,
) -> Result<u16, ProgramError> {
    if !check_id(instruction_sysvar_account_info.key) {
        return Err(ProgramError::UnsupportedSysvar);
    }
    let instruction_sysvar = instruction_sysvar_account_info.try_borrow_data()?;
    let mut instr_fixed_data = [0u8; 2];
    let len = instruction_sysvar.len();
    instr_fixed_data.copy_from_slice(&instruction_sysvar[len - 2..len]);
    Ok(u16::from_le_bytes(instr_fixed_data))
}
pub fn load_current_index_checked ( instruction_sysvar_account_info : & AccountInfo , ) -> Result < u16 , ProgramError > { if ! check_id ( instruction_sysvar_account_info . key ) { return Err ( ProgramError :: UnsupportedSysvar ) ; } let instruction_sysvar = instruction_sysvar_account_info . try_borrow_data ( ) ? ; let mut instr_fixed_data = [ 0u8 ; 2 ] ; let len = instruction_sysvar . len ( ) ; instr_fixed_data . copy_from_slice ( & instruction_sysvar [ len - 2 .. len ] ) ; Ok ( u16 :: from_le_bytes ( instr_fixed_data ) ) }
Load the current `Instruction`'s index in the currently executing
`Transaction`
Load the current ` Instruction ` ' s index in the currently executing ` Transaction `
instruction_sysvar_account_info
&AccountInfo
instruction_sysvar_account_info
&AccountInfo