summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/create_dir.rs
blob: 19c8fc24ba23fa26ff0ba6cf1419c26b70cb2d9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// run-rustfix
#![allow(unused_must_use)]
#![warn(clippy::create_dir)]

use std::fs::create_dir_all;

fn create_dir() {}

fn main() {
    // Should be warned
    std::fs::create_dir("foo");
    std::fs::create_dir("bar").unwrap();

    // Shouldn't be warned
    create_dir();
    std::fs::create_dir_all("foobar");
}