aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/gpubuffer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/gpubuffer.rs')
-rw-r--r--components/script/dom/gpubuffer.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/components/script/dom/gpubuffer.rs b/components/script/dom/gpubuffer.rs
index 7cdffaa7292..430cf031cbb 100644
--- a/components/script/dom/gpubuffer.rs
+++ b/components/script/dom/gpubuffer.rs
@@ -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 &&