diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-10-16 10:18:17 +0200 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2021-10-16 18:11:16 +0200 |
| commit | c645d3f3b99da97b802b1c757fcd1a3c21c84e8a (patch) | |
| tree | 5d19045c7c93edc7c188a793ecc94957c16d4d9d /src | |
| parent | 6cc0a764e082d9c0abcf37a768d5889247ba13e2 (diff) | |
| download | rust-c645d3f3b99da97b802b1c757fcd1a3c21c84e8a.tar.gz rust-c645d3f3b99da97b802b1c757fcd1a3c21c84e8a.zip | |
clippy::complexity changes
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/html/markdown.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/visit_ast.rs | 8 |
2 files changed, 4 insertions, 6 deletions
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<T: doctest::Tester>( // 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::<Vec<_>>() }) |
