title: How to check if a directory exists and create a new one if it doesn't?
body: <p>I tried the following but I don't think it's particularly pretty:</p>
  
  <pre><code>let path = "target/dir";
  if !std::path::Path::new(&amp;path).exists() {
      std::fs::create_dir(path)?;
  }
  </code></pre>