Skip to content

Commit

Permalink
remove unnecessary transmute call
Browse files Browse the repository at this point in the history
  • Loading branch information
antonilol committed Apr 24, 2024
1 parent bcbf21d commit f374447
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/sdl2/rwops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use libc::{c_char, c_int, size_t};
use std::ffi::CString;
use std::io;
use std::marker::PhantomData;
use std::mem::transmute;
use std::path::Path;

use crate::sys;
Expand Down Expand Up @@ -179,7 +178,7 @@ impl<'a> io::Seek for RWops<'a> {
io::SeekFrom::End(pos) => (sys::RW_SEEK_END, pos),
io::SeekFrom::Current(pos) => (sys::RW_SEEK_CUR, pos),
};
let ret = unsafe { ((*self.raw).seek.unwrap())(self.raw, offset, transmute(whence)) };
let ret = unsafe { ((*self.raw).seek.unwrap())(self.raw, offset, whence as i32) };
if ret == -1 {
Err(io::Error::last_os_error())
} else {
Expand Down

0 comments on commit f374447

Please sign in to comment.