pub fn init_account_type(&mut self) -> Result<(), ProgramError> {
        if !self.account_type.is_empty() {
            if let Some(extension_type) = self.get_first_extension_type()? {
                let account_type = extension_type.get_account_type();
                if account_type != S::ACCOUNT_TYPE {
                    return Err(TokenError::ExtensionBaseMismatch.into());
                }
            }
            self.account_type[0] = S::ACCOUNT_TYPE.into();
        }
        Ok(())
    }
/// Write the account type into the buffer, done during the base
/// state initialization
/// Noops if there is no room for an extension in the account, needed for
/// pure base mints / accounts.
Write the account type into the buffer, done during the base
state initialization
Noops if there is no room for an extension in the account, needed for
pure base mints / accounts.
Write the account type into the buffer done during the base state initialization Noops if there is no room for an extension in the account needed for pure base mints / accounts .
pub fn init_account_type(&mut self) -> Result<(), ProgramError> {
        if !self.account_type.is_empty() {
            if let Some(extension_type) = self.get_first_extension_type()? {
                let account_type = extension_type.get_account_type();
                if account_type != S::ACCOUNT_TYPE {
                    return Err(TokenError::ExtensionBaseMismatch.into());
                }
            }
            self.account_type[0] = S::ACCOUNT_TYPE.into();
        }
        Ok(())
    }
pub fn init_account_type ( & mut self ) -> Result < ( ) , ProgramError > { if ! self . account_type . is_empty ( ) { if let Some ( extension_type ) = self . get_first_extension_type ( ) ? { let account_type = extension_type . get_account_type ( ) ; if account_type != S :: ACCOUNT_TYPE { return Err ( TokenError :: ExtensionBaseMismatch . into ( ) ) ; } } self . account_type [ 0 ] = S :: ACCOUNT_TYPE . into ( ) ; } Ok ( ( ) ) }
Write the account type into the buffer, done during the base
state initialization
Noops if there is no room for an extension in the account, needed for
pure base mints / accounts.
Write the account type into the buffer done during the base state initialization Noops if there is no room for an extension in the account needed for pure base mints / accounts .
&mut self
&mut self