google/comprehensive-rust

Don't silence warnings in exercises

Open

#71 ouverte le 27 déc. 2022

Voir sur GitHub
 (4 commentaires) (3 réactions) (0 assignés)Rust (2 009 forks)batch import
enhancementhelp wanted

Métriques du dépôt

Stars
 (32 954 stars)
Métriques de merge PR
 (Merge moyen 9j 23h) (36 PRs mergées en 30 j)

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 -- 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.

Guide contributeur