diff options
author | 2022-12-24 20:04:11 +0300 | |
---|---|---|
committer | 2022-12-24 20:04:23 +0300 | |
commit | b21a125d25eaaa04ba43a9d4d6d8388c5ec3e720 (patch) | |
tree | 654b79dd7ccb648338eda620e93803271ca46653 /rust/regex-rs/src/lib.rs | |
parent | 7bab7659c7d08bc3f97a2308a71c74a7d5b93b84 (diff) | |
download | newsboat-b21a125d25eaaa04ba43a9d4d6d8388c5ec3e720.tar.gz newsboat-b21a125d25eaaa04ba43a9d4d6d8388c5ec3e720.tar.zst newsboat-b21a125d25eaaa04ba43a9d4d6d8388c5ec3e720.zip |
Fix unnecessary cast (Clippy warning)
Diffstat (limited to 'rust/regex-rs/src/lib.rs')
-rw-r--r-- | rust/regex-rs/src/lib.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/rust/regex-rs/src/lib.rs b/rust/regex-rs/src/lib.rs index f6e30edd..50ca9cfe 100644 --- a/rust/regex-rs/src/lib.rs +++ b/rust/regex-rs/src/lib.rs @@ -117,9 +117,7 @@ unsafe fn regex_error_to_str(errcode: libc::c_int, regex: ®ex_t) -> Option<St let errmsg_length = regerror(errcode, regex, ptr::null_mut(), 0); // Allocate the buffer and get the message. - // Casting u64 to usize is safe since the error message is unlikely to hit usize's - // upper bound. - let mut errmsg: Vec<u8> = vec![0; errmsg_length as usize]; + let mut errmsg: Vec<u8> = vec![0; errmsg_length]; // Casting `*mut u8` to `*mut c_char` should be safe since C doesn't really care: // it can store any ASCII symbol in a `char`, disregarding signedness. regerror( |