The dbg! macro prints an expression's value and location to stderr, then returns the value unchanged for inline debugging.
The dbg! macro prints the file, line, and value of an expression, then returns that value unchanged so you can debug without rewriting code. Wrap any expression or variable in dbg!() to inspect it at runtime.
use std::env;
fn main() {
let args: Vec<String> = env::args().collect();
dbg!(args);
}
The dbg! macro is a quick way to see what data your program is holding at a specific moment. It prints the value to your console and then lets the program continue using that same value, acting like a temporary checkpoint. Think of it as a speed bump that flashes a sign with your car's speed but lets you keep driving.