Hacker News new | ask | show | jobs
by dystroy 1638 days ago
Rather than giving always the same crate or author names, it's probably more interesting to learn to recognize repositories which have a higher probability of being "good rust code", so that you can search yourself (starting with repos of well used and well known libraries and programs).

IMO good rust code often

- has most types, functions, macro definitions, etc. correctly commented (don't bother reading code when there are pages without comments)

- has a lot of code snippets in function comments

- has some test units

- has no unjustified `unwrap` and `expect`

- has understandable error management

- has "bench", "tests" and "examples" directories (they're not always necessary but if you see them, the author knows the tools and made some efforts in building a better crate)

- has a proper readme and lib level comments (if it's a lib): people who take pride in a readable documentation often take pride in a good code

I'd also suggest to first look at code which is neither very old (people learnt since and new features were added to the language) nor so recent it didn't mature