mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 07:48:07 +02:00
rusticl/spirv: use bool::then_Some inside SPIRVBin::link
This makes the code way easier to read :) Signed-off-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27204>
This commit is contained in:
parent
93c1eb112f
commit
421b73207c
1 changed files with 5 additions and 14 deletions
|
|
@ -194,24 +194,15 @@ impl SPIRVBin {
|
|||
if !library && res {
|
||||
let mut pspirv = clc_parsed_spirv::default();
|
||||
let res = unsafe { clc_parse_spirv(&out, &logger, &mut pspirv) };
|
||||
|
||||
if res {
|
||||
info = Some(pspirv);
|
||||
} else {
|
||||
info = None;
|
||||
}
|
||||
info = res.then_some(pspirv);
|
||||
} else {
|
||||
info = None;
|
||||
}
|
||||
|
||||
let res = if res {
|
||||
Some(SPIRVBin {
|
||||
spirv: out,
|
||||
info: info,
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let res = res.then_some(SPIRVBin {
|
||||
spirv: out,
|
||||
info: info,
|
||||
});
|
||||
(res, msgs.join("\n"))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue