Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some chrono #933

Merged
merged 2 commits into from
Aug 20, 2020
Merged

Remove some chrono #933

merged 2 commits into from
Aug 20, 2020

Conversation

qm3ster
Copy link
Contributor

@qm3ster qm3ster commented Aug 18, 2020

This PR is only about changes that don't affect public API

duration: Duration,
}

impl Timer {
/// construct timer, initially set and due `duration_in_ms` in the future
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc-strings should be written as proper sentences. They should start with an uppercase letter, and end with a full stop.

Suggested change
/// construct timer, initially set and due `duration_in_ms` in the future
/// Construct a `Timer`, which is initially set to expire in due `duration_in_ms` time from the current instant.

duration,
}
}

/// block until next due time resetting afterwards
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// block until next due time resetting afterwards
/// Block until the due time. The timer will be reset afterwards.

}

/// returns true and resets the timer if due
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// returns true and resets the timer if due
/// Returns a boolean indicating whether the timer has expired. the timer will also be reset if it has.

true
} else {
false
}
}

pub fn reset(&mut self) { self.due = Utc::now() + self.duration; }
/// reset timer to be 1 duration after previous due time
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// reset timer to be 1 duration after previous due time
/// Resets the timer by incrementing the due time using the duration that was passed upon construction of the timer.

self.due += self.duration
}

/// reset timer to be 1 duration from **now**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// reset timer to be 1 duration from **now**
/// Resets the timer by restarting from the current instant and setting its due time to the duration that was passed upon construction. This has the same effect as constructing a new `Timer`.

@arqunis arqunis added the enhancement An improvement to Serenity. label Aug 18, 2020
@arqunis arqunis merged commit 42b78c6 into serenity-rs:current Aug 20, 2020
arqunis pushed a commit to arqunis/serenity that referenced this pull request Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement to Serenity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants