I am a beginner and I write a lot of tutorial code samples for practice in main.rs or other places.
I don't delete them because they are good for reference.
How do i suppress warnings for unused code (variables, functions etc.) when running cargo check.
I want to set this in the environment or setup files.
In the top of the main file:
#![allow(unused)]
1 Like
thanks. it worked.
besde :
#![allow(unused)]
you can also run or build with this env variable:
RUSTFLAGS="-Awarnings" cargo run