google/comprehensive-rust

Don't silence warnings in exercises

Open

#71 创建于 2022年12月27日

在 GitHub 查看
 (4 评论) (3 反应) (0 负责人)Rust (2,009 fork)batch import
enhancementhelp wanted

仓库指标

Star
 (32,954 star)
PR 合并指标
 (平均合并 9天 23小时) (30 天内合并 36 个 PR)

描述

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.

贡献者指南