From 1124a995ef96469daf8593cb7fe9a17ee11bac2e Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Mon, 1 Mar 2021 19:00:04 +0700 Subject: [PATCH] Update to rust-rocket 0.7.2 --- rust-rocket | 2 +- timer.rs | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/rust-rocket b/rust-rocket index 3ca2cab..006eaf1 160000 --- a/rust-rocket +++ b/rust-rocket @@ -1 +1 @@ -Subproject commit 3ca2caba4878c73bfa4d2d7a36c2f3b943f9888a +Subproject commit 006eaf1463af595aa11113b5e4f407e3223a40df diff --git a/timer.rs b/timer.rs index 9f4abe0..9345838 100644 --- a/timer.rs +++ b/timer.rs @@ -4,7 +4,7 @@ use std::time::{Duration, Instant}; use rust_rocket; #[cfg(feature = "editor")] -type Rocket = rust_rocket::Rocket; +type Rocket = rust_rocket::client::RocketClient; #[cfg(not(feature = "editor"))] type Rocket = (); @@ -100,17 +100,19 @@ impl Timer { #[cfg(feature = "editor")] fn poll_rocket(&mut self) { + use rust_rocket::client::Event; + match self.rocket { Some(ref mut rocket) => { let current_row = (self.t * BPS) as u32; - if let Some(event) = rocket.poll_events() { + if let Some(event) = rocket.poll_events().unwrap() { match event { - rust_rocket::Event::SetRow(row) => { + Event::SetRow(row) => { println!("SetRow (row: {:?})", row); self.t = row as f32 / BPS; } - rust_rocket::Event::Pause(_) => { - let track1 = rocket.get_track_mut("test"); + Event::Pause(_) => { + let track1 = rocket.get_track_mut("test").unwrap(); println!("Pause (value: {:?}) (row: {:?})", track1.get_value(current_row as f32), current_row); } _ => (), -- 2.25.1