Skip to content

Commit 4807d50

Browse files
authored
Fix: make UUID retrieval more portable (#90)
The `CUuuid` byte type is `std::os::raw::c_char` and it depends on the platform, whether it is `i8` or `u8` in Rust. With just passing in `0` without a type identifier, both cases are handled. This makes the code more portable.
1 parent 54bd55e commit 4807d50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/cust/src/device.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ impl Device {
342342
/// # }
343343
/// ```
344344
pub fn uuid(self) -> CudaResult<[u8; 16]> {
345-
let mut cu_uuid = CUuuid { bytes: [0i8; 16] };
345+
let mut cu_uuid = CUuuid { bytes: [0; 16] };
346346
unsafe {
347347
cuDeviceGetUuid(&mut cu_uuid, self.device).to_result()?;
348348
}

0 commit comments

Comments
 (0)