diff --git a/emulator/mgba/src/log.rs b/emulator/mgba/src/log.rs index 663a2421..6e7b32f7 100644 --- a/emulator/mgba/src/log.rs +++ b/emulator/mgba/src/log.rs @@ -15,7 +15,6 @@ pub enum LogLevel { Unknown, } - #[derive(Debug, Error)] #[error("A log level of {provided_log_level} does not match any known log level")] pub struct LogLevelIsNotValid { @@ -34,9 +33,11 @@ impl TryFrom for LogLevel { mgba_sys::mLogLevel_mLOG_DEBUG => LogLevel::Debug, mgba_sys::mLogLevel_mLOG_STUB => LogLevel::Stub, mgba_sys::mLogLevel_mLOG_GAME_ERROR => LogLevel::GameError, - _ => return Err(LogLevelIsNotValid { - provided_log_level: value - }) + _ => { + return Err(LogLevelIsNotValid { + provided_log_level: value, + }) + } }) } } @@ -95,7 +96,11 @@ extern "C" fn log_string_wrapper( unsafe { CStr::from_ptr(category_c_name).to_str() }.unwrap_or(UNKNOWN) }; - logger(category_name, LogLevel::try_from(level).unwrap_or(LogLevel::Unknown), s); + logger( + category_name, + LogLevel::try_from(level).unwrap_or(LogLevel::Unknown), + s, + ); } } } diff --git a/emulator/mgba/src/vfile.rs b/emulator/mgba/src/vfile.rs index 97092b3f..0a36b87a 100644 --- a/emulator/mgba/src/vfile.rs +++ b/emulator/mgba/src/vfile.rs @@ -113,14 +113,14 @@ impl VFileAlloc { } pub(crate) fn into_mgba(self) -> *mut mgba_sys::VFile { - let f = Box::into_raw(self.0) as *mut VFileInner; + let f = Box::into_raw(self.0); f.cast() } } mod vfile_extern { - use std::io::SeekFrom; use super::VFileExtensions; + use std::io::SeekFrom; /// Safety: Must be part of a VFileInner pub unsafe fn create_vfile() -> mgba_sys::VFile {