Skip to content

Commit 2b8638f

Browse files
make MillisecondPeriod::from_non_zero a const fn
1 parent 8f8329f commit 2b8638f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl MillisecondPeriod {
8585
/// Try to create the `MillisecondPeriod` from millisecond units.
8686
/// # Panics:
8787
/// If `millis` is zero, the contract was violated.
88-
pub fn from_non_zero(millis: u64) -> Self {
88+
pub const fn from_non_zero(millis: u64) -> Self {
8989
assert!(millis > 0, "`millis` must be non-zero that was the deal");
9090
Self(millis)
9191
}

0 commit comments

Comments
 (0)