rust-exercises icon indicating copy to clipboard operation
rust-exercises copied to clipboard

Draft: port durable file, add incremental tests

Open miguelraz opened this issue 1 year ago • 2 comments

miguelraz avatar Oct 03 '23 19:10 miguelraz

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?

jonathanpallant avatar Oct 06 '23 11:10 jonathanpallant

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.

miguelraz avatar Oct 09 '23 16:10 miguelraz