Skip to content

Commit

Permalink
delay -> dur
Browse files Browse the repository at this point in the history
  • Loading branch information
expenses committed Jan 27, 2020
1 parent 06d1bd8 commit 9f620d7
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/futures-timer.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/delay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ impl Delay {
/// specified by `at`.
#[inline]
pub fn reset(&mut self, dur: Duration) {
if self._reset(delay).is_err() {
if self._reset(dur).is_err() {
self.state = None
}
}

fn _reset(&mut self, delay: Duration) -> Result<(), ()> {
fn _reset(&mut self, dur: Duration) -> Result<(), ()> {
let state = match self.state {
Some(ref state) => state,
None => return Err(()),
Expand All @@ -92,7 +92,7 @@ impl Delay {
Err(s) => bits = s,
}
}
*state.at.lock().unwrap() = Some(Instant::now() + delay);
*state.at.lock().unwrap() = Some(Instant::now() + dur);
// If we fail to push our node then we've become an inert timer, so
// we'll want to clear our `state` field accordingly
timeouts.list.push(state)?;
Expand Down

0 comments on commit 9f620d7

Please sign in to comment.