From 96f3858c96929efea1fd3466032ce8d12338c9be Mon Sep 17 00:00:00 2001 From: Michel Heily Date: Thu, 30 Apr 2020 09:12:45 +0300 Subject: [PATCH] Fix unused warnings when not compiled with elf_support Former-commit-id: a6b38f3affdbfbb436b1ec0d3ec33406f71f9ba2 --- rustboyadvance-core/src/core/cartridge/builder.rs | 2 ++ rustboyadvance-core/src/core/cartridge/loader.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/rustboyadvance-core/src/core/cartridge/builder.rs b/rustboyadvance-core/src/core/cartridge/builder.rs index 1114e84..3e9f87f 100644 --- a/rustboyadvance-core/src/core/cartridge/builder.rs +++ b/rustboyadvance-core/src/core/cartridge/builder.rs @@ -86,11 +86,13 @@ impl GamepakBuilder { pub fn build(mut self) -> GBAResult { let (bytes, symbols) = if let Some(bytes) = self.bytes { match load_from_bytes(bytes.to_vec())? { + #[cfg(feature = "elf_support")] LoadRom::Elf { data, symbols } => Ok((data, Some(symbols))), LoadRom::Raw(data) => Ok((data, None)), } } else if let Some(path) = &self.path { match load_from_file(&path)? { + #[cfg(feature = "elf_support")] LoadRom::Elf { data, symbols } => Ok((data, Some(symbols))), LoadRom::Raw(data) => Ok((data, None)), } diff --git a/rustboyadvance-core/src/core/cartridge/loader.rs b/rustboyadvance-core/src/core/cartridge/loader.rs index 49d6119..474bde5 100644 --- a/rustboyadvance-core/src/core/cartridge/loader.rs +++ b/rustboyadvance-core/src/core/cartridge/loader.rs @@ -1,4 +1,6 @@ use super::super::{GBAError, GBAResult}; + +#[cfg(feature = "elf_support")] use std::collections::HashMap; use std::io::prelude::*; use std::io::Cursor; @@ -11,6 +13,7 @@ use zip::ZipArchive; use goblin; pub enum LoadRom { + #[cfg(feature = "elf_support")] Elf { data: Vec, symbols: HashMap,