#Coding exercise to practice lifetimes?

3 messages · Page 1 of 1 (latest)

young hazel
#

Hey guys, i feel like I dont have a good mental model around lifetimes. When I run into issues i just work with the error messages until i can get it to compile. I can usually get away with not using clone.

This got me wondering if there was a code exercise/problem description to help me learn it? Something simple enough that wouldn't require a lot of lines of code but advanced enough that it forces me to run into lifetime issues and to use lifetimes to solve the problem? The to-do list of Rust, one might call it. I'll even take any improvised suggestions, but i feel something like this should exist formally to really hammer in the idea and let someone new wrap their head around the subject.

inland junco
#

practice code where data jumps around a lot and is created / dropped a lot.

magic geyser
#

Rustlings exercises simplify it a lot.