mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 18:23:49 +00:00
run cargo fmt
This commit is contained in:
parent
3a96d6b603
commit
79b1d9adf0
@ -210,12 +210,7 @@ fn check_fn(cx: &LateContext<'_, '_>, decl: &FnDecl, fn_id: NodeId, opt_body_id:
|
||||
arg.span,
|
||||
"writing `&String` instead of `&str` involves a new object where a slice will do.",
|
||||
|db| {
|
||||
db.span_suggestion(
|
||||
arg.span,
|
||||
"change this to",
|
||||
"&str".into(),
|
||||
Applicability::Unspecified,
|
||||
);
|
||||
db.span_suggestion(arg.span, "change this to", "&str".into(), Applicability::Unspecified);
|
||||
for (clonespan, suggestion) in spans {
|
||||
db.span_suggestion_short(
|
||||
clonespan,
|
||||
|
@ -260,12 +260,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Transmute {
|
||||
arg.as_ty(cx.tcx.mk_ptr(rty_and_mut)).as_ty(to_ty)
|
||||
};
|
||||
|
||||
db.span_suggestion(
|
||||
e.span,
|
||||
"try",
|
||||
sugg.to_string(),
|
||||
Applicability::Unspecified,
|
||||
);
|
||||
db.span_suggestion(e.span, "try", sugg.to_string(), Applicability::Unspecified);
|
||||
}
|
||||
},
|
||||
),
|
||||
@ -436,12 +431,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Transmute {
|
||||
|db| {
|
||||
if let Some(arg) = sugg::Sugg::hir_opt(cx, &args[0]) {
|
||||
let sugg = arg.as_ty(cx.tcx.mk_ptr(to_ty));
|
||||
db.span_suggestion(
|
||||
e.span,
|
||||
"try",
|
||||
sugg.to_string(),
|
||||
Applicability::Unspecified,
|
||||
);
|
||||
db.span_suggestion(e.span, "try", sugg.to_string(), Applicability::Unspecified);
|
||||
}
|
||||
},
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user