Add a "DateDelta" datatype for differences in number of days#858
Add a "DateDelta" datatype for differences in number of days#858esheppa wants to merge 1 commit into
Conversation
|
This could potentially target |
|
Actually, upon re-reading this, I think the only thing I'd have to change is to leave |
|
Sorry, I've paged out my context on why we needed/wanted this as an addition. (If we want to do it, doing it on 0.4.x first seems like a great idea. Would also be nice to rewrite the commit message to have a shorter first line introduction.) |
|
Fair call - the main idea here is to have a proper return type for things like |
2f1eea5 to
10db47e
Compare
1678d91 to
f9c9f9a
Compare
|
Been thinking about this more. What if instead of all the |
|
This sounds reasonable to me. From the implementation, the only time What if we had the following functions: And then we would also not implement the |
|
Yeah, sounds good! I think I would go with |
f9c9f9a to
2696485
Compare
* change Days to contain a u32 * changes to Iterator Implementations * minor docs fixes * add days_since function
2696485 to
04207e3
Compare
|
Had another thought of just using |
|
What's the point of changing from |
|
This was originally combined with the work in d086ca9 and in the implementations of |
jtmoon79
left a comment
There was a problem hiding this comment.
Please add attribute #[must_use] to new and modified functions.
| } | ||
|
|
||
| check((2014, 1, 1), Days::new(0), Some((2014, 1, 1))); | ||
| check((2014, 1, 1), Days::from_u32(0), Some((2014, 1, 1))); |
There was a problem hiding this comment.
For backwards compatibility checks, could you add some tests cases (or statements within a test case) to compare Days::new and Days::from_u32 result in the same values?
I know new is the "old way", but wouldn't hurt to make sure it's still working.
|
Why was this abandoned? I'm thinking of creating a similar PR. Before I do, I'd like to know if it's worth it. |
|
Because the author became inactive. I think the latest iteration of this is #1290. |
change Days to take a u32 and addition of DaysDelta to NaiveDate, changes to Iterator Implementations
This has been separated out from #824