From b21a125d25eaaa04ba43a9d4d6d8388c5ec3e720 Mon Sep 17 00:00:00 2001 From: Alexander Batischev Date: Sat, 24 Dec 2022 20:04:11 +0300 Subject: Fix unnecessary cast (Clippy warning) --- rust/regex-rs/src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'rust/regex-rs/src/lib.rs') 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 = vec![0; errmsg_length as usize]; + let mut errmsg: Vec = 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( -- cgit v1.2.3