Skip to content

Commit a79e37e

Browse files
committed
clippy
1 parent 0f1dbfc commit a79e37e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/device.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,20 @@ impl PhysicalDevice {
7171
let device_name = cstring_to_string(
7272
physical_device_properties
7373
.device_name_as_c_str()
74-
.unwrap_or_else(|_| CStr::from_bytes_with_nul(b"Unknown\0").unwrap()),
74+
.unwrap_or(c"Unknown"),
7575
);
7676
let device_type = DeviceType::from(physical_device_properties.device_type.as_raw());
7777
let device_id = physical_device_properties.device_id;
7878
let api_version = decode_version_number(physical_device_properties.api_version);
7979
let driver_name = cstring_to_string(
8080
driver_properties
8181
.driver_name_as_c_str()
82-
.unwrap_or_else(|_| CStr::from_bytes_with_nul(b"Unknown\0").unwrap()),
82+
.unwrap_or(c"Unknown"),
8383
);
8484
let driver_info = cstring_to_string(
8585
driver_properties
8686
.driver_info_as_c_str()
87-
.unwrap_or_else(|_| CStr::from_bytes_with_nul(b"Unknown\0").unwrap()),
87+
.unwrap_or(c"Unknown"),
8888
);
8989

9090
// Query VRAM details.
@@ -254,7 +254,7 @@ mod tests {
254254
#[test]
255255
fn test_decode_version_number() {
256256
// Simulate a Vulkan version: variant 0, version 1.2.3
257-
let version: u32 = (0 << 29) | (1 << 22) | (2 << 12) | 3;
257+
let version: u32 = (1 << 22) | (2 << 12) | 3;
258258
let decoded = decode_version_number(version);
259259
assert_eq!(decoded, "0.1.2.3");
260260
}

0 commit comments

Comments
 (0)