rt(vk): use Option::filter
instead of let_chains
This commit is contained in:
parent
57f9a13ee7
commit
0ba4c482b3
|
@ -185,8 +185,8 @@ impl FrameResiduals {
|
|||
}
|
||||
}
|
||||
for framebuffer in self.framebuffers.drain(0..) {
|
||||
if let Some(framebuffer) = framebuffer
|
||||
&& framebuffer != vk::Framebuffer::null()
|
||||
if let Some(framebuffer) =
|
||||
framebuffer.filter(|framebuffer| *framebuffer != vk::Framebuffer::null())
|
||||
{
|
||||
unsafe {
|
||||
self.device.destroy_framebuffer(framebuffer, None);
|
||||
|
|
|
@ -34,9 +34,7 @@ impl PipelineDescriptors<'_> {
|
|||
}
|
||||
|
||||
pub fn add_ubo_binding(&mut self, ubo_meta: Option<&BufferReflection<u32>>) {
|
||||
if let Some(ubo_meta) = ubo_meta
|
||||
&& !ubo_meta.stage_mask.is_empty()
|
||||
{
|
||||
if let Some(ubo_meta) = ubo_meta.filter(|ubo_meta| !ubo_meta.stage_mask.is_empty()) {
|
||||
let ubo_mask = util::binding_stage_to_vulkan_stage(ubo_meta.stage_mask);
|
||||
|
||||
self.layout_bindings.push(vk::DescriptorSetLayoutBinding {
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
//! See [`librashader::runtime::vk`](https://docs.rs/librashader/latest/librashader/runtime/vk/index.html) instead.
|
||||
#![deny(unsafe_op_in_unsafe_fn)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![feature(let_chains)]
|
||||
|
||||
mod draw_quad;
|
||||
mod filter_chain;
|
||||
|
|
Loading…
Reference in a new issue