cargo clippy
cargo clippy(smart compiler) is a tool to catch:
- Linting issues
- rust idiomatic, efficient, and maintainable code
- It doesn't just check for bugs; it suggests better ways to write
logic
- warns about performance pitfalls
- Common mistakes and improve your Rust code
- adhere to the community-standard Rust style
cargo build/run is standard Rust compiler (rustc) focuses
on ensuring your code is valid and safe
fn main() {
let my_vec = vec![1, 2, 3];
for i in 0..my_vec.len() {
println!("{}", my_vec[i]);
}
}
|
|