Re-add erroneously removed newlines

This commit is contained in:
Joshua Salzedo 2021-03-21 17:01:13 -07:00
parent dcdd768e03
commit f8d63279ef
No known key found for this signature in database
GPG Key ID: C3D0EB484493B731
2 changed files with 5 additions and 1 deletions

View File

@ -37,6 +37,7 @@ impl Duration {
ticks: secs * TICKS_PER_SECOND,
}
}
/// Creates a duration from the specified number of milliseconds
pub const fn from_millis(millis: u64) -> Duration {
Duration {
@ -61,19 +62,21 @@ impl Duration {
.checked_add(rhs.ticks)
.map(|ticks| Duration { ticks })
}
/// Subtracts one Duration to another, returning a new Duration or None in the event of an overflow.
pub fn checked_sub(self, rhs: Duration) -> Option<Duration> {
self.ticks
.checked_sub(rhs.ticks)
.map(|ticks| Duration { ticks })
}
/// Multiplies one Duration to another, returning a new Duration or None in the event of an overflow.
/// Multiplies one Duration to another, returning a new Duration or None in the event of an overflow.
pub fn checked_mul(self, rhs: u32) -> Option<Duration> {
self.ticks
.checked_mul(rhs as _)
.map(|ticks| Duration { ticks })
}
/// Divides one Duration against another, returning a new Duration or None in the event of an overflow.
pub fn checked_div(self, rhs: u32) -> Option<Duration> {
self.ticks

View File

@ -31,6 +31,7 @@ impl Instant {
ticks: millis * TICKS_PER_SECOND as u64 / 1000,
}
}
/// Instant representing seconds since MCU start.
pub const fn from_secs(seconds: u64) -> Self {
Self {