From 5266d8f5d8889dc2e9d313c84d1d31738f857ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 7 Jan 2025 10:59:53 +0400 Subject: [PATCH] qemu-display: impl AsRef for ScanoutMmap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau --- qemu-display/src/console_listener.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qemu-display/src/console_listener.rs b/qemu-display/src/console_listener.rs index 0bec922..22ffbd5 100644 --- a/qemu-display/src/console_listener.rs +++ b/qemu-display/src/console_listener.rs @@ -88,10 +88,6 @@ impl ScanoutMap { } impl ScanoutMmap { - pub fn as_ref(&self) -> &[u8] { - self.mmap.as_ref() - } - pub fn stride(&self) -> u32 { self.scanout.stride } @@ -101,6 +97,12 @@ impl ScanoutMmap { } } +impl AsRef<[u8]> for ScanoutMmap { + fn as_ref(&self) -> &[u8] { + self.mmap.as_ref() + } +} + #[derive(Debug, Copy, Clone)] pub struct UpdateMap { pub x: i32,