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

std.time.epoch: delete YearLeapKind #23054

Closed
wants to merge 2 commits into from
Closed

Conversation

wooster0
Copy link

@wooster0 wooster0 commented Mar 3, 2025

There doesn't really seem to be a point in having this type.
Code seems to be improved without it.

Skimming through code that references the type I could find like 2-3 actual uses of it so it probably doesn't need a deprecation period.

@rohlem
Copy link
Contributor

rohlem commented Mar 3, 2025

Not a big deal, but I personally don't really see this as an improvement. getDaysInMonth(false, .feb) is less descriptive.

For bool -> kind we could add a factory function callable as decl literal .fromBool(is) / .fromIsLeapYear(is), for the other way a method .isLeapYear().
(In my own code base I'd use this to get rid of all other @enumFromInt / @intFromEnum outside of these method implementations.)

Getting rid of unnecessary @as is unrelated, but nice.

wooster0 added 2 commits March 3, 2025 21:45
There doesn't really seem to be a point in having this type.
Code seems to be improved without it.
@alexrp
Copy link
Member

alexrp commented Mar 3, 2025

#21280

@wooster0 wooster0 closed this Mar 3, 2025
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.

3 participants