Skip to content

Commit 951a366

Browse files
committed
remove redundant import (clippy::single_component_path_imports)
remove redundant format!() call (clippy::useless_format) don't use ok() before calling expect() (clippy::ok_expect)
1 parent 2835ca6 commit 951a366

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

src/librustc_lint/types.rs

-2
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ fn lint_int_literal<'a, 'tcx>(
273273
cx.sess()
274274
.source_map()
275275
.span_to_snippet(lit.span)
276-
.ok()
277276
.expect("must get snippet from literal"),
278277
t.name_str(),
279278
min,
@@ -338,7 +337,6 @@ fn lint_uint_literal<'a, 'tcx>(
338337
cx.sess()
339338
.source_map()
340339
.span_to_snippet(lit.span)
341-
.ok()
342340
.expect("must get snippet from literal"),
343341
t.name_str(),
344342
min,

src/librustc_typeck/impl_wf_check/min_specialization.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ fn check_static_lifetimes<'tcx>(
270270
span: Span,
271271
) {
272272
if tcx.any_free_region_meets(parent_substs, |r| *r == ty::ReStatic) {
273-
tcx.sess.struct_span_err(span, &format!("cannot specialize on `'static` lifetime")).emit();
273+
tcx.sess.struct_span_err(span, "cannot specialize on `'static` lifetime").emit();
274274
}
275275
}
276276

src/librustdoc/passes/calculate_doc_coverage.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use rustc_ast::attr;
88
use rustc_span::symbol::sym;
99
use rustc_span::FileName;
1010
use serde::Serialize;
11-
use serde_json;
1211

1312
use std::collections::BTreeMap;
1413
use std::ops;

0 commit comments

Comments
 (0)