You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For instance, I have a situation where I am aggregating data on a monthly basis, year by year. For that, I have a YearMonth struct like this:
structYearMonth{year:i32,month:Month,}
For the actual calculation, this is then used as key in a HashMap, or part of a tuple inside a Vec. I then want to find all the YearMonth for the last 12 months, which means I have a comparison like .filter(|year_month| year_month >= current_year_month.month.minus_one_year()) . Since Month does not implement PartialOrd, I cannot simply derive the implementation for YearMonth, but have to implement my own.
The text was updated successfully, but these errors were encountered:
It would be nice if Month implemented PartialOrd.
For instance, I have a situation where I am aggregating data on a monthly basis, year by year. For that, I have a YearMonth struct like this:
For the actual calculation, this is then used as key in a
HashMap
, or part of a tuple inside aVec
. I then want to find all theYearMonth
for the last 12 months, which means I have a comparison like.filter(|year_month| year_month >= current_year_month.month.minus_one_year())
. SinceMonth
does not implementPartialOrd
, I cannot simply derive the implementation forYearMonth
, but have to implement my own.The text was updated successfully, but these errors were encountered: