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.
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!");
}
}
Thanks... I should have searched this, thought I'd not find it.
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.