We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
MillisecondPeriod::from_non_zero
1 parent 8f8329f commit 2b8638fCopy full SHA for 2b8638f
src/types.rs
@@ -85,7 +85,7 @@ impl MillisecondPeriod {
85
/// Try to create the `MillisecondPeriod` from millisecond units.
86
/// # Panics:
87
/// If `millis` is zero, the contract was violated.
88
- pub fn from_non_zero(millis: u64) -> Self {
+ pub const fn from_non_zero(millis: u64) -> Self {
89
assert!(millis > 0, "`millis` must be non-zero that was the deal");
90
Self(millis)
91
}
0 commit comments