all: use let chains
This commit is contained in:
parent
3d5d146d65
commit
286857971a
89 changed files with 1516 additions and 1574 deletions
|
|
@ -179,10 +179,10 @@ impl UsrJayRenderCtxOwner for PortalDisplay {
|
|||
};
|
||||
let dev_id = drm.dev();
|
||||
let mut render_ctx = None;
|
||||
if let Some(ctx) = self.state.render_ctxs.get(&dev_id) {
|
||||
if let Some(ctx) = ctx.upgrade() {
|
||||
render_ctx = Some(ctx);
|
||||
}
|
||||
if let Some(ctx) = self.state.render_ctxs.get(&dev_id)
|
||||
&& let Some(ctx) = ctx.upgrade()
|
||||
{
|
||||
render_ctx = Some(ctx);
|
||||
}
|
||||
if render_ctx.is_none() {
|
||||
let ctx = match create_gfx_context(
|
||||
|
|
@ -553,10 +553,10 @@ pub(super) async fn watch_displays(state: Rc<PortalState>) {
|
|||
}
|
||||
};
|
||||
for event in events {
|
||||
if event.mask.contains(c::IN_CREATE) {
|
||||
if let Ok(s) = std::str::from_utf8(event.name().as_ustr().as_bytes()) {
|
||||
maybe_add_display(&state, s).await;
|
||||
}
|
||||
if event.mask.contains(c::IN_CREATE)
|
||||
&& let Ok(s) = std::str::from_utf8(event.name().as_ustr().as_bytes())
|
||||
{
|
||||
maybe_add_display(&state, s).await;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -353,18 +353,18 @@ impl StartedScreencast {
|
|||
return Err(BufferAllocationError::NoRenderContext);
|
||||
};
|
||||
let mut usage = BO_USE_RENDERING;
|
||||
if let Some(sf) = &ctx.server_formats {
|
||||
if let Some(format) = sf.get(&format.drm) {
|
||||
let no_render_usage = modifiers.iter().all(|m| {
|
||||
format
|
||||
.write_modifiers
|
||||
.get(m)
|
||||
.map(|w| !w.needs_render_usage)
|
||||
.unwrap_or(false)
|
||||
});
|
||||
if no_render_usage {
|
||||
usage = BufferUsage::none();
|
||||
}
|
||||
if let Some(sf) = &ctx.server_formats
|
||||
&& let Some(format) = sf.get(&format.drm)
|
||||
{
|
||||
let no_render_usage = modifiers.iter().all(|m| {
|
||||
format
|
||||
.write_modifiers
|
||||
.get(m)
|
||||
.map(|w| !w.needs_render_usage)
|
||||
.unwrap_or(false)
|
||||
});
|
||||
if no_render_usage {
|
||||
usage = BufferUsage::none();
|
||||
}
|
||||
}
|
||||
let buffer = ctx.ctx.ctx.allocator().create_bo(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue