Skip to content

Conversation

ExplodingWaffle
Copy link

Wanted to initialise an Instant in a static, but I couldn't because zero() is a (non-const) fn. AFAIK you can't have const fns in traits, so no constifying zero() - this is the next best thing, I think.
Since from_ticks() in fugit is const, implementing this is the same as zero() -

const ZERO: Self::Instant = Self::Instant::from_ticks(0);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant