These are chat archives for rust-lang/rust

15th
Mar 2019
Ash
@ashthespy
Mar 15 00:00
return it - print it..
side question - does cargo let you conditionally compile code if it's a debug vs release build?
Joey
@OddCoincidence
Mar 15 03:13
you can for asserts, e.g. debug_assert!(<predicate>) but I've never found a way to do it for arbitrary code
matrixbot
@matrixbot
Mar 15 03:24
bspeice if cfg!(debug_assertions) { /* debug only */ } should do effectively the same thing.
Ash
@ashthespy
Mar 15 13:24
@matrixbot @OddCoincidence Yes it works!
Reference
https://doc.rust-lang.org/cargo/reference/manifest.html#the-profile-sections