rs: Use &* instead of .as_ref().unwrap()

This commit is contained in:
angie 2023-12-10 20:09:49 -03:00
parent 15011a8c18
commit 7d0de275c5
2 changed files with 6 additions and 2 deletions

View File

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Changed
- Minor cleanups on Rust code.
## [1.8.0] - 2023-11-12
### Added

View File

@ -562,11 +562,11 @@ impl Instruction {
}
pub fn get_operand_type(&self, index: usize) -> operand_type_enum::OperandType {
unsafe { self.descriptor.as_ref().unwrap().get_operand_type(index) }
unsafe { &*self.descriptor }.get_operand_type(index)
}
pub fn get_operands_slice(&self) -> &[operand_type_enum::OperandType] {
unsafe { self.descriptor.as_ref().unwrap().operands_slice() }
unsafe { &*self.descriptor }.operands_slice()
}
pub fn instr_suffix(&self) -> instr_suffix_enum::InstrSuffix {