From cbd085c25b2f4d326e493ad0570212a77e17400d Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Tue, 13 Apr 2021 23:02:13 -0500 Subject: [PATCH] chore: use Default::default instead of Type::Default --- src/cartridge.rs | 2 +- src/main.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cartridge.rs b/src/cartridge.rs index 6042310..4f66dd5 100644 --- a/src/cartridge.rs +++ b/src/cartridge.rs @@ -387,7 +387,7 @@ impl std::clone::Clone for Box { } } -impl std::default::Default for Box { +impl Default for Box { fn default() -> Self { Box::new(Mbc1::default()) } diff --git a/src/main.rs b/src/main.rs index 7b2266f..f7be0e6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -65,7 +65,7 @@ fn main() -> Result<()> { let mut pixels = create_pixels(&window)?; let mut now = Instant::now(); - let mut cycles_in_frame = Cycle::default(); + let mut cycles_in_frame: Cycle = Default::default(); event_loop.run(move |event, _, control_flow| { if let Event::RedrawRequested(_) = event { if pixels @@ -95,7 +95,7 @@ fn main() -> Result<()> { let cycle_time = Duration::from_secs_f64(LR35902_CYCLE_TIME).subsec_nanos(); let pending_cycles = Cycle::new(delta / cycle_time); - let mut elapsed_cycles = Cycle::default(); + let mut elapsed_cycles: Cycle = Default::default(); while elapsed_cycles <= pending_cycles { elapsed_cycles += game_boy.step(); } @@ -108,7 +108,7 @@ fn main() -> Result<()> { ppu.copy_to_gui(frame); window.request_redraw(); - cycles_in_frame = Cycle::default() + cycles_in_frame = Default::default() } } });