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.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/script/dom/gpubuffer.rs b/components/script/dom/gpubuffer.rs
index 488ef614b92..d90a37b559d 100644
--- a/components/script/dom/gpubuffer.rs
+++ b/components/script/dom/gpubuffer.rs
@@ -296,7 +296,7 @@ impl GPUBufferMethods for GPUBuffer {
let range_size = if let Some(s) = size {
s
} else {
- self.size.checked_sub(offset).unwrap_or(0)
+ self.size.saturating_sub(offset)
};
// Step 2: validation
let mut mapping = self.mapping.borrow_mut();