Skip to content

Commit

Permalink
Auto merge of #90635 - matthiaskrgr:rustdoc_compl, r=GuillaumeGomez
Browse files Browse the repository at this point in the history
rustdoc: clippy::complexity fixes
  • Loading branch information
bors committed Nov 7, 2021
2 parents 089a016 + 952fea7 commit 88b4ea8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ impl Clean<Item> for hir::TraitItem<'_> {
}
hir::TraitItemKind::Fn(ref sig, hir::TraitFn::Required(names)) => {
let (generics, decl) = enter_impl_trait(cx, |cx| {
(self.generics.clean(cx), (&*sig.decl, &names[..]).clean(cx))
(self.generics.clean(cx), (sig.decl, names).clean(cx))
});
let mut t = Function { header: sig.header, decl, generics };
if t.header.constness == hir::Constness::Const
Expand Down Expand Up @@ -2063,9 +2063,8 @@ impl Clean<Item> for (&hir::ForeignItem<'_>, Option<Symbol>) {
let kind = match item.kind {
hir::ForeignItemKind::Fn(decl, names, ref generics) => {
let abi = cx.tcx.hir().get_foreign_abi(item.hir_id());
let (generics, decl) = enter_impl_trait(cx, |cx| {
(generics.clean(cx), (&*decl, &names[..]).clean(cx))
});
let (generics, decl) =
enter_impl_trait(cx, |cx| (generics.clean(cx), (decl, names).clean(cx)));
ForeignFunctionItem(Function {
decl,
generics,
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/scrape_examples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl ScrapeExamplesOptions {
target_crates,
})),
(Some(_), false) | (None, true) => {
diag.err(&format!("must use --scrape-examples-output-path and --scrape-examples-target-crate together"));
diag.err("must use --scrape-examples-output-path and --scrape-examples-target-crate together");
Err(1)
}
(None, false) => Ok(None),
Expand Down

0 comments on commit 88b4ea8

Please sign in to comment.