Skip to content

Commit 643f618

Browse files
committed
Fix clippy uninlined format args warnings in cust crate
1 parent 7546091 commit 643f618

4 files changed

Lines changed: 6 additions & 8 deletions

File tree

crates/cust/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl fmt::Display for CudaError {
105105
.to_result()
106106
.map_err(|_| fmt::Error)?;
107107
let cstr = CStr::from_ptr(ptr);
108-
write!(f, "{:?}", cstr)
108+
write!(f, "{cstr:?}")
109109
}
110110
}
111111
// This shouldn't happen

crates/cust/src/memory/array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl ArrayFormat {
139139
// there are literally no docs on what nv12 is???
140140
// it seems to be something with multiplanar arrays, needs some investigation
141141
CUarray_format_enum::CU_AD_FORMAT_NV12 => panic!("nv12 is not supported yet"),
142-
_ => panic!("Unsupported array format: {:?}", raw),
142+
_ => panic!("Unsupported array format: {raw:?}"),
143143
}
144144
}
145145

crates/cust/src/memory/device/device_buffer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ impl<T: DeviceCopy + Zeroable> DeviceBuffer<T> {
288288

289289
#[cfg(feature = "bytemuck")]
290290
fn casting_went_wrong(src: &str, err: PodCastError) -> ! {
291-
panic!("{}>{:?}", src, err);
291+
panic!("{src}>{err:?}");
292292
}
293293

294294
#[cfg(feature = "bytemuck")]

crates/cust/src/memory/device/device_slice.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,7 @@ pub trait DeviceSliceIndex<T: DeviceCopy> {
446446
#[track_caller]
447447
fn slice_start_index_len_fail(index: usize, len: usize) -> ! {
448448
panic!(
449-
"range start index {} out of range for slice of length {}",
450-
index, len
449+
"range start index {index} out of range for slice of length {len}"
451450
);
452451
}
453452

@@ -456,16 +455,15 @@ fn slice_start_index_len_fail(index: usize, len: usize) -> ! {
456455
#[track_caller]
457456
fn slice_end_index_len_fail(index: usize, len: usize) -> ! {
458457
panic!(
459-
"range end index {} out of range for slice of length {}",
460-
index, len
458+
"range end index {index} out of range for slice of length {len}"
461459
);
462460
}
463461

464462
#[inline(never)]
465463
#[cold]
466464
#[track_caller]
467465
fn slice_index_order_fail(index: usize, end: usize) -> ! {
468-
panic!("slice index starts at {} but ends at {}", index, end);
466+
panic!("slice index starts at {index} but ends at {end}");
469467
}
470468

471469
#[inline(never)]

0 commit comments

Comments
 (0)