From d58af1f2b21d28109ab880fc175a7ef7733ee9e3 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 31 Jul 2024 18:28:39 -0700 Subject: [PATCH] change function name to reflect what it does --- src/timer.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/timer.rs b/src/timer.rs index a051c20..5e2308b 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -131,7 +131,7 @@ impl TimerFixed{ //pause and unpause is generic across TimerState impl TimerFixed{ - pub fn unpause(self,time:Time)->TimerFixed{ + pub fn into_unpaused(self,time:Time)->TimerFixed{ let new_time=self.time(time); let mut timer=TimerFixed{ state:self.state, @@ -142,7 +142,7 @@ impl TimerFixed{ } } impl TimerFixed{ - pub fn pause(self,time:Time)->TimerFixed{ + pub fn into_paused(self,time:Time)->TimerFixed{ let new_time=self.time(time); let mut timer=TimerFixed{ state:self.state, @@ -202,12 +202,12 @@ impl Timer{ pub fn pause(self,time:Time)->Result,Error>{ match self{ Self::Paused(_)=>Err(Error::AlreadyPaused), - Self::Unpaused(timer)=>Ok(timer.pause(time)), + Self::Unpaused(timer)=>Ok(timer.into_paused(time)), } } pub fn unpause(self,time:Time)->Result,Error>{ match self{ - Self::Paused(timer)=>Ok(timer.unpause(time)), + Self::Paused(timer)=>Ok(timer.into_unpaused(time)), Self::Unpaused(_)=>Err(Error::AlreadyUnpaused), } }