Skip to content

Commit

Permalink
Switch back to casting metadata to *const u8 for c_char = i8 platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
itsjunetime committed Oct 18, 2024
1 parent 76c5133 commit 773997b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arrow-schema/src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,12 @@ impl FFI_ArrowSchema {
Ok(HashMap::new())
} else {
let mut pos = 0;
let buffer: *const u8 = self.metadata;

// On some platforms, c_char = u8, and on some, c_char = i8. Where c_char = u8, clippy
// wants to complain that we're casting to the same type, but if we remove the cast,
// this will fail to compile on the other platforms. So we must allow it.
#[allow(clippy::unnecessary_cast)]
let buffer: *const u8 = self.metadata as *const u8;

fn next_four_bytes(buffer: *const u8, pos: &mut isize) -> [u8; 4] {
let out = unsafe {
Expand Down

0 comments on commit 773997b

Please sign in to comment.