Skip to content

Commit

Permalink
remove redundant import (clippy::single_component_path_imports)
Browse files Browse the repository at this point in the history
remove redundant format!() call (clippy::useless_format)
don't use ok() before calling expect() (clippy::ok_expect)
  • Loading branch information
matthiaskrgr committed Mar 20, 2020
1 parent 2835ca6 commit 951a366
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
2 changes: 0 additions & 2 deletions src/librustc_lint/types.rs
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/impl_wf_check/min_specialization.rs
Expand Up @@ -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();
}
}

Expand Down
1 change: 0 additions & 1 deletion src/librustdoc/passes/calculate_doc_coverage.rs
Expand Up @@ -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;
Expand Down

0 comments on commit 951a366

Please sign in to comment.