Determine if app is being debugged

How can I know if the current crate is being compiled through cargo run? I tried this:

fn main() {
    #[cfg(debug)]
    {
        println!("Hi!");
    }
}

It doesn't do anything in the playground.

fn main() {
    #[cfg(debug_assertions)]
    {
        println!("Hi!");
    }
}
1 Like

Thanks... I should have searched this, thought I'd not find it.