Rust noob asks: lifetime of a reference in a struct

Thanks for the replies!

I was aware that I can clone NaiveDate, it just feels cleaner for me not to duplicate data with one identity. Redundancy in a data model just feels error prone for me.

However, it’s a learning project, so I can live with that one. But I fear there will be more compromises I’ll have to accept then.

In a next step, I wanted to put the HashMap values in linked lists, so that I can both, easily (O(log n)) pick a single DayDescriptor via the HashMap and easily (O(1)) pick a DayDescriptor for a subsequent day, if it already exists in the map. Again, that would need some references.

That’s really a pity. For my understanding, this makes a huge amount of efficient data models impossible. And in my experience, well performing algorithms are more important than the speed of the language in many cases. Anyway, I hope that I will soon think that Rust is easy. :wink: