Skip to content
Snippets Groups Projects
Verified Commit 2ec72fb9 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

chore: improved use structure

parent 9d303c9e
No related branches found
No related tags found
No related merge requests found
Pipeline #3163 passed
...@@ -2,14 +2,6 @@ ...@@ -2,14 +2,6 @@
pub mod consts; pub mod consts;
use std::{
collections::HashMap,
ffi::CStr,
fmt::{self, Display, Formatter},
os::raw::{c_char, c_float, c_uint, c_void},
slice::from_raw_parts,
};
use boytacean::{ use boytacean::{
debugln, debugln,
gb::{AudioProvider, GameBoy}, gb::{AudioProvider, GameBoy},
...@@ -25,6 +17,13 @@ use consts::{ ...@@ -25,6 +17,13 @@ use consts::{
RETRO_DEVICE_ID_JOYPAD_START, RETRO_DEVICE_ID_JOYPAD_UP, RETRO_DEVICE_ID_JOYPAD_X, RETRO_DEVICE_ID_JOYPAD_START, RETRO_DEVICE_ID_JOYPAD_UP, RETRO_DEVICE_ID_JOYPAD_X,
RETRO_DEVICE_ID_JOYPAD_Y, RETRO_DEVICE_JOYPAD, RETRO_DEVICE_ID_JOYPAD_Y, RETRO_DEVICE_JOYPAD,
}; };
use std::{
collections::HashMap,
ffi::CStr,
fmt::{self, Display, Formatter},
os::raw::{c_char, c_float, c_uint, c_void},
slice::from_raw_parts,
};
use crate::consts::{REGION_NTSC, RETRO_API_VERSION}; use crate::consts::{REGION_NTSC, RETRO_API_VERSION};
......
...@@ -1072,7 +1072,7 @@ impl Default for Apu { ...@@ -1072,7 +1072,7 @@ impl Default for Apu {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::Apu;
#[test] #[test]
fn test_trigger_ch1() { fn test_trigger_ch1() {
......
...@@ -588,7 +588,7 @@ impl Default for Cpu { ...@@ -588,7 +588,7 @@ impl Default for Cpu {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use crate::cpu::Cpu; use super::Cpu;
#[test] #[test]
fn test_cpu_clock() { fn test_cpu_clock() {
......
use crate::serial::SerialDevice;
use std::{ use std::{
fmt::{self, Display, Formatter}, fmt::{self, Display, Formatter},
io::{stdout, Write}, io::{stdout, Write},
}; };
use crate::serial::SerialDevice;
pub struct StdoutDevice { pub struct StdoutDevice {
flush: bool, flush: bool,
callback: fn(buffer: &Vec<u8>), callback: fn(buffer: &Vec<u8>),
......
...@@ -119,7 +119,7 @@ impl Default for Dma { ...@@ -119,7 +119,7 @@ impl Default for Dma {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use crate::dma::{Dma, DmaMode}; use super::{Dma, DmaMode};
#[test] #[test]
fn test_dma_default() { fn test_dma_default() {
......
...@@ -198,7 +198,7 @@ impl Display for GameGenieCode { ...@@ -198,7 +198,7 @@ impl Display for GameGenieCode {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use crate::genie::GameGenieCode; use super::GameGenieCode;
#[test] #[test]
fn test_from_code() { fn test_from_code() {
......
...@@ -46,7 +46,9 @@ pub fn replace_ext(path: &str, new_extension: &str) -> Option<String> { ...@@ -46,7 +46,9 @@ pub fn replace_ext(path: &str, new_extension: &str) -> Option<String> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use std::path::Path;
use super::replace_ext;
#[test] #[test]
fn test_change_extension() { fn test_change_extension() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment