Update to rust-rocket 0.7.2
authorBernie Innocenti <bernie@codewiz.org>
Mon, 1 Mar 2021 12:00:04 +0000 (19:00 +0700)
committerBernie Innocenti <bernie@codewiz.org>
Mon, 1 Mar 2021 12:00:04 +0000 (19:00 +0700)
rust-rocket
timer.rs

index 3ca2caba4878c73bfa4d2d7a36c2f3b943f9888a..006eaf1463af595aa11113b5e4f407e3223a40df 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 3ca2caba4878c73bfa4d2d7a36c2f3b943f9888a
+Subproject commit 006eaf1463af595aa11113b5e4f407e3223a40df
index 9f4abe0fa85ce830642c4a3f2e942f420a792375..93458388961fc272201867377c5357033cf2b947 100644 (file)
--- 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);
                         }
                         _ => (),