@@ -94,7 +94,6 @@ mod seek_from_current;
9494mod seek_to_start_instead_of_rewind;
9595mod single_char_add_str;
9696mod single_char_insert_string;
97- mod single_char_pattern;
9897mod single_char_push_string;
9998mod skip_while_next;
10099mod stable_sort_primitive;
@@ -1141,38 +1140,6 @@ declare_clippy_lint! {
11411140 "not returning type containing `Self` in a `new` method"
11421141}
11431142
1144- declare_clippy_lint ! {
1145- /// ### What it does
1146- /// Checks for string methods that receive a single-character
1147- /// `str` as an argument, e.g., `_.split("x")`.
1148- ///
1149- /// ### Why is this bad?
1150- /// While this can make a perf difference on some systems,
1151- /// benchmarks have proven inconclusive. But at least using a
1152- /// char literal makes it clear that we are looking at a single
1153- /// character.
1154- ///
1155- /// ### Known problems
1156- /// Does not catch multi-byte unicode characters. This is by
1157- /// design, on many machines, splitting by a non-ascii char is
1158- /// actually slower. Please do your own measurements instead of
1159- /// relying solely on the results of this lint.
1160- ///
1161- /// ### Example
1162- /// ```rust,ignore
1163- /// _.split("x");
1164- /// ```
1165- ///
1166- /// Use instead:
1167- /// ```rust,ignore
1168- /// _.split('x');
1169- /// ```
1170- #[ clippy:: version = "pre 1.29.0" ]
1171- pub SINGLE_CHAR_PATTERN ,
1172- pedantic,
1173- "using a single-character str where a char could be used, e.g., `_.split(\" x\" )`"
1174- }
1175-
11761143declare_clippy_lint ! {
11771144 /// ### What it does
11781145 /// Checks for calling `.step_by(0)` on iterators which panics.
@@ -4169,7 +4136,6 @@ impl_lint_pass!(Methods => [
41694136 FLAT_MAP_OPTION ,
41704137 INEFFICIENT_TO_STRING ,
41714138 NEW_RET_NO_SELF ,
4172- SINGLE_CHAR_PATTERN ,
41734139 SINGLE_CHAR_ADD_STR ,
41744140 SEARCH_IS_SOME ,
41754141 FILTER_NEXT ,
@@ -4324,7 +4290,6 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
43244290 inefficient_to_string:: check ( cx, expr, method_call. ident . name , receiver, args) ;
43254291 single_char_add_str:: check ( cx, expr, receiver, args) ;
43264292 into_iter_on_ref:: check ( cx, expr, method_span, method_call. ident . name , receiver) ;
4327- single_char_pattern:: check ( cx, expr, method_call. ident . name , receiver, args) ;
43284293 unnecessary_to_owned:: check ( cx, expr, method_call. ident . name , receiver, args, & self . msrv ) ;
43294294 } ,
43304295 ExprKind :: Binary ( op, lhs, rhs) if op. node == hir:: BinOpKind :: Eq || op. node == hir:: BinOpKind :: Ne => {
0 commit comments