Skip to content

Commit 01e302b

Browse files
committed
Fix dogfood
1 parent e3c6044 commit 01e302b

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

clippy_lints/src/map_unit_fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ fn unit_closure<'tcx>(
190190
/// Anything else will return `a`.
191191
fn let_binding_name(cx: &LateContext<'_>, var_arg: &hir::Expr<'_>) -> String {
192192
match &var_arg.kind {
193-
hir::ExprKind::Field(_, _) => snippet(cx, var_arg.span, "_").replace(".", "_"),
193+
hir::ExprKind::Field(_, _) => snippet(cx, var_arg.span, "_").replace('.', "_"),
194194
hir::ExprKind::Path(_) => format!("_{}", snippet(cx, var_arg.span, "")),
195195
_ => "a".to_string(),
196196
}

clippy_lints/src/nonstandard_macro_braces.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ fn is_offending_macro<'a>(cx: &EarlyContext<'_>, span: Span, mac_braces: &'a Mac
112112
if snip.starts_with(&format!("{}!", name));
113113
if unnested_or_local();
114114
// make formatting consistent
115-
let c = snip.replace(" ", "");
115+
let c = snip.replace(' ', "");
116116
if !c.starts_with(&format!("{}!{}", name, braces.0));
117117
if !mac_braces.done.contains(&span.ctxt().outer_expn_data().call_site);
118118
then {

clippy_lints/src/self_named_constructors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl<'tcx> LateLintPass<'tcx> for SelfNamedConstructors {
7676
let self_id = cx.tcx.hir().local_def_id_to_hir_id(self_local_did);
7777
if let Some(Node::Item(x)) = cx.tcx.hir().find(self_id);
7878
let type_name = x.ident.name.as_str().to_lowercase();
79-
if impl_item.ident.name.as_str() == type_name || impl_item.ident.name.as_str().replace("_", "") == type_name;
79+
if impl_item.ident.name.as_str() == type_name || impl_item.ident.name.as_str().replace('_', "") == type_name;
8080

8181
then {
8282
span_lint(

clippy_lints/src/unicode.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ fn check_str(cx: &LateContext<'_>, span: Span, id: HirId) {
106106
"invisible character detected",
107107
"consider replacing the string with",
108108
string
109-
.replace("\u{200B}", "\\u{200B}")
110-
.replace("\u{ad}", "\\u{AD}")
111-
.replace("\u{2060}", "\\u{2060}"),
109+
.replace('\u{200B}', "\\u{200B}")
110+
.replace('\u{ad}', "\\u{AD}")
111+
.replace('\u{2060}', "\\u{2060}"),
112112
Applicability::MachineApplicable,
113113
);
114114
}

clippy_lints/src/write.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -583,10 +583,10 @@ impl Write {
583583
let replacement: String = match lit.token.kind {
584584
LitKind::Integer | LitKind::Float | LitKind::Err => continue,
585585
LitKind::StrRaw(_) | LitKind::ByteStrRaw(_) if matches!(fmtstr.style, StrStyle::Raw(_)) => {
586-
lit.token.symbol.as_str().replace("{", "{{").replace("}", "}}")
586+
lit.token.symbol.as_str().replace('{', "{{").replace('}', "}}")
587587
},
588588
LitKind::Str | LitKind::ByteStr if matches!(fmtstr.style, StrStyle::Cooked) => {
589-
lit.token.symbol.as_str().replace("{", "{{").replace("}", "}}")
589+
lit.token.symbol.as_str().replace('{', "{{").replace('}', "}}")
590590
},
591591
LitKind::StrRaw(_) | LitKind::Str | LitKind::ByteStrRaw(_) | LitKind::ByteStr => continue,
592592
LitKind::Byte | LitKind::Char => match &*lit.token.symbol.as_str() {

0 commit comments

Comments
 (0)