Fix clippy::implicit_saturating_sub lints (#7395)

This commit is contained in:
Bruce Mitchener authored and GitHub committed 2025-03-22 13:17:34 -04:00
1 parent edd0ef80af
commit ccaf9a84f8
2 files changed
+2 -6

No files matched your search

+1 -3
View File
@@ -2188,10 +2188,8 @@ impl Global {
let range_size = if let Some(size) = size {
size
} else if offset > buffer.size {
0
} else {
buffer.size - offset
buffer.size.saturating_sub(offset)
};
if offset % wgt::MAP_ALIGNMENT != 0 {
+1 -3
View File
@@ -439,10 +439,8 @@ impl Buffer {
) -> Result<SubmissionIndex, (BufferMapOperation, BufferAccessError)> {
let range_size = if let Some(size) = size {
size
} else if offset > self.size {
0
} else {
self.size - offset
self.size.saturating_sub(offset)
};
if offset % wgt::MAP_ALIGNMENT != 0 {