Fix unused warnings when not compiled with elf_support
Former-commit-id: a6b38f3affdbfbb436b1ec0d3ec33406f71f9ba2
This commit is contained in:
parent
08bda05d52
commit
96f3858c96
|
@ -86,11 +86,13 @@ impl GamepakBuilder {
|
||||||
pub fn build(mut self) -> GBAResult<Cartridge> {
|
pub fn build(mut self) -> GBAResult<Cartridge> {
|
||||||
let (bytes, symbols) = if let Some(bytes) = self.bytes {
|
let (bytes, symbols) = if let Some(bytes) = self.bytes {
|
||||||
match load_from_bytes(bytes.to_vec())? {
|
match load_from_bytes(bytes.to_vec())? {
|
||||||
|
#[cfg(feature = "elf_support")]
|
||||||
LoadRom::Elf { data, symbols } => Ok((data, Some(symbols))),
|
LoadRom::Elf { data, symbols } => Ok((data, Some(symbols))),
|
||||||
LoadRom::Raw(data) => Ok((data, None)),
|
LoadRom::Raw(data) => Ok((data, None)),
|
||||||
}
|
}
|
||||||
} else if let Some(path) = &self.path {
|
} else if let Some(path) = &self.path {
|
||||||
match load_from_file(&path)? {
|
match load_from_file(&path)? {
|
||||||
|
#[cfg(feature = "elf_support")]
|
||||||
LoadRom::Elf { data, symbols } => Ok((data, Some(symbols))),
|
LoadRom::Elf { data, symbols } => Ok((data, Some(symbols))),
|
||||||
LoadRom::Raw(data) => Ok((data, None)),
|
LoadRom::Raw(data) => Ok((data, None)),
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
use super::super::{GBAError, GBAResult};
|
use super::super::{GBAError, GBAResult};
|
||||||
|
|
||||||
|
#[cfg(feature = "elf_support")]
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::io::prelude::*;
|
use std::io::prelude::*;
|
||||||
use std::io::Cursor;
|
use std::io::Cursor;
|
||||||
|
@ -11,6 +13,7 @@ use zip::ZipArchive;
|
||||||
use goblin;
|
use goblin;
|
||||||
|
|
||||||
pub enum LoadRom {
|
pub enum LoadRom {
|
||||||
|
#[cfg(feature = "elf_support")]
|
||||||
Elf {
|
Elf {
|
||||||
data: Vec<u8>,
|
data: Vec<u8>,
|
||||||
symbols: HashMap<String, u32>,
|
symbols: HashMap<String, u32>,
|
||||||
|
|
Reference in a new issue