1
Fork 0

Auto merge of #94139 - est31:let_else_rustdoc, r=notriddle

librustdoc: adopt let else in more places

Continuation of #89933, #91018, #91481, #93046, #93590, #94011.

I have extended my clippy lint to also recognize tuple passing and match statements. The diff caused by fixing it is way above 1 thousand lines. Thus, I split it up into multiple pull requests to make reviewing easier. This PR handles librustdoc.
This commit is contained in:
bors 2022-03-14 07:39:53 +00:00
commit b7511248f9
16 changed files with 51 additions and 95 deletions

View file

@ -57,10 +57,8 @@ crate fn krate(cx: &mut DocContext<'_>) -> Crate {
let primitives = local_crate.primitives(cx.tcx);
let keywords = local_crate.keywords(cx.tcx);
{
let m = match *module.kind {
ItemKind::ModuleItem(ref mut m) => m,
_ => unreachable!(),
};
let ItemKind::ModuleItem(ref mut m) = *module.kind
else { unreachable!() };
m.items.extend(primitives.iter().map(|&(def_id, prim)| {
Item::from_def_id_and_parts(
def_id,