diff options
author | Silas Bartha <[email protected]> | 2024-12-11 15:16:46 -0500 |
---|---|---|
committer | Silas Bartha <[email protected]> | 2024-12-11 15:16:46 -0500 |
commit | 33bd014e55503ff342175488be428440f75c9452 (patch) | |
tree | 09c831dcf29a699df3a545251c034cd42bbd99ac /src/main.rs | |
parent | 3fa06f0c09b0ab27a2182eb1e7ebe01b51f731e0 (diff) |
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index eff799c..35c8bd0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -117,7 +117,7 @@ async fn get_iteration(connection: &Connection) -> Result<(), fdo::Error> { &(), ) .await?; - let iteration: u8 = m.body().unwrap(); + let iteration: u8 = m.body().deserialize()?; println!("{}", iteration + 1); Ok(()) } @@ -132,7 +132,7 @@ async fn get_remaining(connection: &Connection) -> Result<(), fdo::Error> { &(), ) .await?; - let remaining: Duration = m.body().unwrap(); + let remaining: Duration = m.body().deserialize()?; let remaining_secs = remaining.as_secs(); println!("{:02}:{:02}", remaining_secs / 60, remaining_secs % 60); Ok(()) @@ -148,7 +148,7 @@ async fn is_running(connection: &Connection) -> Result<(), fdo::Error> { &(), ) .await?; - let is_running: bool = m.body().unwrap(); + let is_running: bool = m.body().deserialize()?; println!("{}", is_running as u8); Ok(()) } @@ -163,7 +163,7 @@ async fn is_on_break(connection: &Connection) -> Result<(), fdo::Error> { &(), ) .await?; - let is_on_break: bool = m.body().unwrap(); + let is_on_break: bool = m.body().deserialize()?; println!("{}", is_on_break as u8); Ok(()) } |