title: How can one detect the OS type using Rust?
body: <p>How can one detect the OS type using Rust? I need to specify a default path specific to the OS. Should one use conditional compilation?</p>
  
  <p>For example: </p>
  
  <pre><code>#[cfg(target_os = "macos")]
  static DEFAULT_PATH: &amp;str = "path2";
  #[cfg(target_os = "linux")]
  static DEFAULT_PATH: &amp;str = "path0";
  #[cfg(target_os = "windows")]
  static DEFAULT_PATH: &amp;str = "path1";
  </code></pre>