1
Fork 0

librustdoc: adopt let else in more places

This commit is contained in:
est31 2022-02-19 00:43:47 +01:00
parent 65f6d33b77
commit 565f644edf
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,