Format let-else

This commit is contained in:
Lukas Wirth 2023-07-03 20:34:09 +02:00
parent 28fcd1bdd7
commit 69cd3c30ac
38 changed files with 572 additions and 306 deletions

View file

@ -636,7 +636,8 @@ fn render_const_scalar(
}
hir_def::AdtId::EnumId(e) => {
let Some((var_id, var_layout)) =
detect_variant_from_bytes(&layout, f.db, krate, b, e) else {
detect_variant_from_bytes(&layout, f.db, krate, b, e)
else {
return f.write_str("<failed-to-detect-variant>");
};
let data = &f.db.enum_data(e).variants[var_id];