Skip to content

Commit 607905d

Browse files
committed
Add STD_FS_CREATE_DIR into paths
1 parent 5574182 commit 607905d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

clippy_lints/src/create_dir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::utils::{match_qpath, snippet, span_lint_and_sugg};
1+
use crate::utils::{match_qpath, paths, snippet, span_lint_and_sugg};
22
use if_chain::if_chain;
33
use rustc_errors::Applicability;
44
use rustc_hir::*;
@@ -33,7 +33,7 @@ impl LateLintPass<'_> for CreateDir {
3333
if_chain! {
3434
if let ExprKind::Call(ref func, ref args) = expr.kind;
3535
if let ExprKind::Path(ref path) = func.kind;
36-
if match_qpath(path, &["std", "fs", "create_dir"]);
36+
if match_qpath(path, &paths::STD_FS_CREATE_DIR);
3737
then {
3838
span_lint_and_sugg(
3939
cx,

clippy_lints/src/utils/paths.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ pub const SLICE_ITER: [&str; 3] = ["core", "slice", "Iter"];
110110
pub const STDERR: [&str; 4] = ["std", "io", "stdio", "stderr"];
111111
pub const STDOUT: [&str; 4] = ["std", "io", "stdio", "stdout"];
112112
pub const STD_CONVERT_IDENTITY: [&str; 3] = ["std", "convert", "identity"];
113+
pub const STD_FS_CREATE_DIR: [&str; 3] = ["std", "fs", "create_dir"];
113114
pub const STD_MEM_TRANSMUTE: [&str; 3] = ["std", "mem", "transmute"];
114115
pub const STD_PTR_NULL: [&str; 3] = ["std", "ptr", "null"];
115116
pub const STRING_AS_MUT_STR: [&str; 4] = ["alloc", "string", "String", "as_mut_str"];

0 commit comments

Comments
 (0)