diff options
author | Daniel McCarney <daniel@binaryparadox.net> | 2024-09-09 16:40:33 -0400 |
---|---|---|
committer | Daniel McCarney <daniel@binaryparadox.net> | 2024-09-10 08:09:21 -0400 |
commit | 781cadb424e2aa77770c4021c707f5be3cd9e1f1 (patch) | |
tree | bc8d7cf8ea67946da90043804b4e2887e6628eee | |
parent | e084c94e130f77b1c91d24c5e3cbb252e51c1d51 (diff) |
lib: remove usize cast from `try_slice!`
Prevent unsafety from using with incorrect argument type. Assume
`$count` is already a `usize` and let the compiler err otherwise.
-rw-r--r-- | src/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -672,7 +672,7 @@ macro_rules! try_slice { if $ptr.is_null() { return $crate::panic::NullParameterOrDefault::value(); } else { - unsafe { slice::from_raw_parts($ptr, $count as usize) } + unsafe { slice::from_raw_parts($ptr, $count) } } }; } |