@@ -61,11 +61,8 @@ mod zst_offset;
61
61
62
62
use bind_instead_of_map:: BindInsteadOfMap ;
63
63
use clippy_utils:: diagnostics:: { span_lint, span_lint_and_help} ;
64
- use clippy_utils:: source:: snippet_with_applicability;
65
64
use clippy_utils:: ty:: { contains_ty, implements_trait, is_copy, is_type_diagnostic_item} ;
66
65
use if_chain:: if_chain;
67
- use rustc_ast:: ast;
68
- use rustc_errors:: Applicability ;
69
66
use rustc_hir as hir;
70
67
use rustc_hir:: { TraitItem , TraitItemKind } ;
71
68
use rustc_lint:: { LateContext , LateLintPass , LintContext } ;
@@ -1979,34 +1976,6 @@ fn lint_binary_expr_with_method_call(cx: &LateContext<'_>, info: &mut BinaryExpr
1979
1976
lint_with_both_lhs_and_rhs ! ( chars_last_cmp_with_unwrap:: check, cx, info) ;
1980
1977
}
1981
1978
1982
- fn get_hint_if_single_char_arg (
1983
- cx : & LateContext < ' _ > ,
1984
- arg : & hir:: Expr < ' _ > ,
1985
- applicability : & mut Applicability ,
1986
- ) -> Option < String > {
1987
- if_chain ! {
1988
- if let hir:: ExprKind :: Lit ( lit) = & arg. kind;
1989
- if let ast:: LitKind :: Str ( r, style) = lit. node;
1990
- let string = r. as_str( ) ;
1991
- if string. chars( ) . count( ) == 1 ;
1992
- then {
1993
- let snip = snippet_with_applicability( cx, arg. span, & string, applicability) ;
1994
- let ch = if let ast:: StrStyle :: Raw ( nhash) = style {
1995
- let nhash = nhash as usize ;
1996
- // for raw string: r##"a"##
1997
- & snip[ ( nhash + 2 ) ..( snip. len( ) - 1 - nhash) ]
1998
- } else {
1999
- // for regular string: "a"
2000
- & snip[ 1 ..( snip. len( ) - 1 ) ]
2001
- } ;
2002
- let hint = format!( "'{}'" , if ch == "'" { "\\ '" } else { ch } ) ;
2003
- Some ( hint)
2004
- } else {
2005
- None
2006
- }
2007
- }
2008
- }
2009
-
2010
1979
const FN_HEADER : hir:: FnHeader = hir:: FnHeader {
2011
1980
unsafety : hir:: Unsafety :: Normal ,
2012
1981
constness : hir:: Constness :: NotConst ,
0 commit comments