Skip to content

Commit 3d9b45d

Browse files
committed
move single_char_add_str to its own module
1 parent 4843084 commit 3d9b45d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
use crate::methods::{single_char_insert_string, single_char_push_string};
2+
use crate::utils::match_def_path;
3+
use crate::utils::paths;
4+
use rustc_hir as hir;
5+
use rustc_lint::LateContext;
6+
7+
pub(super) fn check(cx: &LateContext<'_>, expr: &hir::Expr<'_>, args: &[hir::Expr<'_>]) {
8+
if let Some(fn_def_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id) {
9+
if match_def_path(cx, fn_def_id, &paths::PUSH_STR) {
10+
single_char_push_string::check(cx, expr, args);
11+
} else if match_def_path(cx, fn_def_id, &paths::INSERT_STR) {
12+
single_char_insert_string::check(cx, expr, args);
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)