Skip to content

Commit

Permalink
rustdoc: clippy::complexity fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Nov 5, 2021
1 parent 045612b commit 952fea7
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
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
Expand Up @@ -49,7 +49,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 952fea7

Please sign in to comment.