We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d6caf4 commit cc36e6fCopy full SHA for cc36e6f
src/utils/src/lib.rs
@@ -32,6 +32,15 @@ pub fn get_page_size() -> Result<usize, errno::Error> {
32
}
33
34
35
+/// Safely converts a u32 value to a usize value.
36
+/// This bypasses the Clippy lint check because we only support 64-bit platforms.
37
+#[cfg(target_pointer_width = "64")]
38
+#[inline]
39
+#[allow(clippy::cast_possible_truncation)]
40
+pub const fn u32_to_usize(num: u32) -> usize {
41
+ num as usize
42
+}
43
+
44
/// Safely converts a u64 value to a usize value.
45
/// This bypasses the Clippy lint check because we only support 64-bit platforms.
46
#[cfg(target_pointer_width = "64")]
0 commit comments