rust-exercises
rust-exercises copied to clipboard
Draft: port durable file, add incremental tests
I was never keen on this exercise because files flush themselves on drop anyway, so panicking on drop because some method wasn't previously called never seemed very helpful.
What topics have you found it useful for covering?
We just had a very positive feedback from the Open Intro to Rust group where
- we had implemented some of our own traits in the
Shapes
exercise - they were keen on taking their time and asking a lot of questions
- the experience of implementing a stdlib trait was qualitatively different than implementing your own invented trait
Our trainees usually appreciate the multiple places where rust-analyzer
suggests a missing import be included or populates missing impl methods, and where we show how to navigate the documentation of a trait via std.rs/$TRAIT
in a web browser.
I will agree though, the same above benefits could be achieved by implementing another std trait - not a huge fan of the DurableFile
implementation either, and I also agree that it's not the best place to just give up and pepper panic!
's in there.