2

I have a particular function that is unused on one platform, but I would still like it to be compiled. Is there any way to #[allow(dead_code)] for only a particular configuration?

Here's some example code:

#[ (what do I put here?) ]
fn cross_platform() {
}

#[cfg(windows)]
pub fn windows_only() {
    // Do a cross-platform thing
    cross_platform();
}

Is there any way to suppress the dead code warning on non-Windows platforms only?

ddulaney
  • 843
  • 7
  • 19

0 Answers0