From 951a3661adf95b58a351b1ee10fe508e37dc17a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Thu, 19 Mar 2020 22:09:26 +0100 Subject: [PATCH] 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) --- src/librustc_lint/types.rs | 2 -- src/librustc_typeck/impl_wf_check/min_specialization.rs | 2 +- src/librustdoc/passes/calculate_doc_coverage.rs | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/librustc_lint/types.rs b/src/librustc_lint/types.rs index 4949c93d45eed..fcd50001cb3a9 100644 --- a/src/librustc_lint/types.rs +++ b/src/librustc_lint/types.rs @@ -273,7 +273,6 @@ fn lint_int_literal<'a, 'tcx>( cx.sess() .source_map() .span_to_snippet(lit.span) - .ok() .expect("must get snippet from literal"), t.name_str(), min, @@ -338,7 +337,6 @@ fn lint_uint_literal<'a, 'tcx>( cx.sess() .source_map() .span_to_snippet(lit.span) - .ok() .expect("must get snippet from literal"), t.name_str(), min, diff --git a/src/librustc_typeck/impl_wf_check/min_specialization.rs b/src/librustc_typeck/impl_wf_check/min_specialization.rs index cae8837611846..ef94500f5c444 100644 --- a/src/librustc_typeck/impl_wf_check/min_specialization.rs +++ b/src/librustc_typeck/impl_wf_check/min_specialization.rs @@ -270,7 +270,7 @@ fn check_static_lifetimes<'tcx>( span: Span, ) { if tcx.any_free_region_meets(parent_substs, |r| *r == ty::ReStatic) { - tcx.sess.struct_span_err(span, &format!("cannot specialize on `'static` lifetime")).emit(); + tcx.sess.struct_span_err(span, "cannot specialize on `'static` lifetime").emit(); } } diff --git a/src/librustdoc/passes/calculate_doc_coverage.rs b/src/librustdoc/passes/calculate_doc_coverage.rs index f48224512ba4f..98300385c8fb8 100644 --- a/src/librustdoc/passes/calculate_doc_coverage.rs +++ b/src/librustdoc/passes/calculate_doc_coverage.rs @@ -8,7 +8,6 @@ use rustc_ast::attr; use rustc_span::symbol::sym; use rustc_span::FileName; use serde::Serialize; -use serde_json; use std::collections::BTreeMap; use std::ops;