mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 23:04:07 +00:00
Spell out the type of the result from map_pass_err
.
Without these changes, rust-analyzer cannot determine the type of `cmd_buf`.
This commit is contained in:
parent
8e5ac75d45
commit
284ed4654e
@ -309,8 +309,11 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
let (device_guard, mut token) = hub.devices.read(&mut token);
|
||||
|
||||
let (mut cmd_buf_guard, mut token) = hub.command_buffers.write(&mut token);
|
||||
let cmd_buf = CommandBuffer::get_encoder_mut(&mut *cmd_buf_guard, encoder_id)
|
||||
.map_pass_err(init_scope)?;
|
||||
// Spell out the type, to placate rust-analyzer.
|
||||
// https://github.com/rust-lang/rust-analyzer/issues/12247
|
||||
let cmd_buf: &mut CommandBuffer<A> =
|
||||
CommandBuffer::get_encoder_mut(&mut *cmd_buf_guard, encoder_id)
|
||||
.map_pass_err(init_scope)?;
|
||||
// will be reset to true if recording is done without errors
|
||||
cmd_buf.status = CommandEncoderStatus::Error;
|
||||
let raw = cmd_buf.encoder.open();
|
||||
|
@ -1050,8 +1050,11 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
let (trackers, query_reset_state, pending_discard_init_fixups) = {
|
||||
let (mut cmb_guard, mut token) = hub.command_buffers.write(&mut token);
|
||||
|
||||
let cmd_buf = CommandBuffer::get_encoder_mut(&mut *cmb_guard, encoder_id)
|
||||
.map_pass_err(init_scope)?;
|
||||
// Spell out the type, to placate rust-analyzer.
|
||||
// https://github.com/rust-lang/rust-analyzer/issues/12247
|
||||
let cmd_buf: &mut CommandBuffer<A> =
|
||||
CommandBuffer::get_encoder_mut(&mut *cmb_guard, encoder_id)
|
||||
.map_pass_err(init_scope)?;
|
||||
// close everything while the new command encoder is filled
|
||||
cmd_buf.encoder.close();
|
||||
// will be reset to true if recording is done without errors
|
||||
|
Loading…
Reference in New Issue
Block a user