Hacker News new | past | comments | ask | show | jobs | submit login

The only violator I found in these exercises is the one that uses mutexes. The suggested answer involves `val.lock().unwrap()`, which is (anecdotally) common in real Rust code. An error result of a mutex unlock implies that another thread panicked while holding the lock[0], so propagating that panic is likely the right answer in this case.

[0]: https://doc.rust-lang.org/std/sync/struct.Mutex.html#poisoni...




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: