changed match to 'matches!' (#31850)

This commit is contained in:
Aarya Khandelwal 2024-03-25 16:58:12 +05:30 committed by GitHub
parent 9a76dd9325
commit bd39e03eeb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 185 additions and 229 deletions

View file

@ -301,10 +301,11 @@ impl GPUBufferMethods for GPUBuffer {
} else {
return Err(Error::Operation);
};
let mut valid = match self.state.get() {
GPUBufferState::Mapped | GPUBufferState::MappedAtCreation => true,
_ => false,
};
let mut valid = matches!(
self.state.get(),
GPUBufferState::Mapped | GPUBufferState::MappedAtCreation
);
valid &= offset % RANGE_OFFSET_ALIGN_MASK == 0 &&
range_size % RANGE_SIZE_ALIGN_MASK == 0 &&
offset >= m_info.mapping_range.start &&