From d9a0ab1a9f830d6ffda16d3656eb0df83762190f Mon Sep 17 00:00:00 2001 From: Corwin Date: Tue, 8 Aug 2023 09:44:29 +0100 Subject: [PATCH] make non rust trait parts of vfile private --- emulator/mgba/src/vfile.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 {