google / google/comprehensive-rust

Don't silence warnings in exercises

Open
#71 4 comments 3 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
Rust
Stars
33.4k
Forks
2.1k
Avg merge
1d 3h
Merged PRs (30d)
10

Description

All the exercises start with something like
```
// TODO: remove this when you're done with your implementation.
#![allow(unused_variables, dead_code)]
```
You're training people that it's normal and a good idea to ignore warnings during development. Instead, [continue to emphasize what you mention in passing elsewhere](https://google.github.io/comprehensive-rust/why-rust/modern.html) -- Rust has great compiler errors!

Of course it's going to have a lot of warnings at the start since you've given them incomplete code. You can
* Just let them deal with it
* Or mention `RUSTFLAGS=-A... cargo ...` perhaps

But you shouldn't imply ignoring warnings until you're "done with your implementation" is a good idea, or IMO that ignoring warnings in your source code (as opposed to a command line flag) is a good idea.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.