We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4843084 commit 3d9b45dCopy full SHA for 3d9b45d
clippy_lints/src/methods/single_char_add_str.rs
@@ -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