diff --git a/emulator/mgba/src/vfile.rs b/emulator/mgba/src/vfile.rs index c6ac8e95..97092b3f 100644 --- a/emulator/mgba/src/vfile.rs +++ b/emulator/mgba/src/vfile.rs @@ -13,7 +13,7 @@ pub enum MapFlag { Write, } -pub trait VFile: Seek + Read + Write { +trait VFileExtensions: VFile { fn readline(&mut self, buffer: &mut [u8]) -> Result { let mut byte = 0; while byte < buffer.len() - 1 { @@ -92,6 +92,10 @@ pub trait VFile: Seek + Read + Write { } } +pub trait VFile: Seek + Read + Write {} + +impl VFileExtensions for T {} + #[repr(C)] struct VFileInner { vfile: mgba_sys::VFile, @@ -116,6 +120,7 @@ impl VFileAlloc { mod vfile_extern { use std::io::SeekFrom; + use super::VFileExtensions; /// Safety: Must be part of a VFileInner pub unsafe fn create_vfile() -> mgba_sys::VFile {