From c645d3f3b99da97b802b1c757fcd1a3c21c84e8a Mon Sep 17 00:00:00 2001 From: Matthias Krüger Date: Sat, 16 Oct 2021 10:18:17 +0200 Subject: clippy::complexity changes --- src/librustdoc/html/markdown.rs | 2 +- src/librustdoc/visit_ast.rs | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index 9f2e282fce1..c46439b8510 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -765,7 +765,7 @@ crate fn find_testable_code( // If there are characters between the preceding line ending and // this code block, `str::lines` will return an additional line, // which we subtract here. - if nb_lines != 0 && !&doc[prev_offset..offset.start].ends_with("\n") { + if nb_lines != 0 && !&doc[prev_offset..offset.start].ends_with('\n') { nb_lines -= 1; } let line = tests.get_line() + nb_lines + 1; diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index 36b1a14f6c1..b13ab64011d 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -113,11 +113,9 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { .unwrap_or(&[]) .iter() .filter_map(|attr| { - Some( - Cfg::parse(attr.meta_item()?) - .map_err(|e| self.cx.sess().diagnostic().span_err(e.span, e.msg)) - .ok()?, - ) + Cfg::parse(attr.meta_item()?) + .map_err(|e| self.cx.sess().diagnostic().span_err(e.span, e.msg)) + .ok() }) .collect::>() }) -- cgit 1.4.1-3-g733a5