How to fix Rust E0433 failed to resolve

Fix Rust E0433 by adding missing dependencies to Cargo.toml or correcting the module path in your use statement.

The E0433 error occurs because the compiler cannot find the module or crate you are trying to use. Add the missing crate to your Cargo.toml dependencies or use the correct use statement to bring the module into scope.

[dependencies]
rand = "0.8"
use rand::Rng;

fn main() {
    let secret_number = rand::thread_rng().gen_range(1..=100);
    println!("The secret number is: {secret_number}");
}