Skip to content

fix: replace year-to-days conversion with miles-to-km in newtype example#2007

Merged
marioidival merged 1 commit intorust-lang:masterfrom
Abhinav-ranish:fix/1995-newtype-time-fallacy
Apr 1, 2026
Merged

fix: replace year-to-days conversion with miles-to-km in newtype example#2007
marioidival merged 1 commit intorust-lang:masterfrom
Abhinav-ranish:fix/1995-newtype-time-fallacy

Conversation

@Abhinav-ranish
Copy link
Copy Markdown
Contributor

Fixes #1995

The year-to-days example propagated the well-known "1 year = 365 days" fallacy. Replaced with a miles-to-kilometers conversion which is mathematically exact (factor 1.609344) while still clearly demonstrating the New Type Idiom.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 1, 2026

r? @marioidival

rustbot has assigned @marioidival.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @marioidival

@marioidival marioidival merged commit 321dc45 into rust-lang:master Apr 1, 2026
1 check passed
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.

RBE promulgates a fallacy about time

3 participants