Skip to content

Commit 85a1f8b

Browse files
committed
Apply style suggestions while keeping rw and cargo fmt
1 parent f065633 commit 85a1f8b

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

wgpu-hal/src/metal/conv.rs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -366,13 +366,10 @@ pub fn map_resource_usage(ty: &wgt::BindingType) -> MTLResourceUsage {
366366
},
367367
wgt::BindingType::Sampler(..) => MTLResourceUsage::empty(),
368368
wgt::BindingType::Buffer { ty, .. } => match ty {
369-
wgt::BufferBindingType::Uniform => MTLResourceUsage::Read,
370-
wgt::BufferBindingType::Storage { read_only } => {
371-
if *read_only {
372-
MTLResourceUsage::Read
373-
} else {
374-
MTLResourceUsage::Read | MTLResourceUsage::Write
375-
}
369+
wgt::BufferBindingType::Uniform
370+
| wgt::BufferBindingType::Storage { read_only: true } => MTLResourceUsage::Read,
371+
wgt::BufferBindingType::Storage { read_only: false } => {
372+
MTLResourceUsage::Read | MTLResourceUsage::Write
376373
}
377374
},
378375
_ => unreachable!(),
@@ -381,14 +378,10 @@ pub fn map_resource_usage(ty: &wgt::BindingType) -> MTLResourceUsage {
381378

382379
pub fn map_binding_access(ty: &wgt::BufferBindingType) -> MTLBindingAccess {
383380
match ty {
384-
wgt::BufferBindingType::Uniform => MTLBindingAccess::ReadOnly,
385-
wgt::BufferBindingType::Storage { read_only } => {
386-
if *read_only {
387-
MTLBindingAccess::ReadOnly
388-
} else {
389-
MTLBindingAccess::ReadWrite
390-
}
381+
wgt::BufferBindingType::Uniform | wgt::BufferBindingType::Storage { read_only: true } => {
382+
MTLBindingAccess::ReadOnly
391383
}
384+
wgt::BufferBindingType::Storage { read_only: false } => MTLBindingAccess::ReadWrite,
392385
}
393386
}
394387

wgpu-hal/src/metal/device.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ impl crate::Device for super::Device {
994994
conv::map_binding_access(&ty),
995995
);
996996

997-
// Argument encoder reports the required size and alignment
997+
// Argument encoder reports the required size and alignment
998998
// of the pointer-array buffer.
999999
let encoder = device
10001000
.newArgumentEncoderWithArguments(&NSArray::from_retained_slice(

0 commit comments

Comments
 (0)