Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use std::fmt::Formatter::debug_struct for RenderPass. #3100

Merged
merged 1 commit into from
Oct 13, 2022

Conversation

jimblandy
Copy link
Member

@jimblandy jimblandy commented Oct 13, 2022

Checklist

  • Run cargo clippy.
  • Run RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown if applicable.
  • [-] (not worthwhile) Add change to CHANGELOG.md. See simple instructions inside file.

@cwfitzgerald cwfitzgerald merged commit fa4d840 into gfx-rs:master Oct 13, 2022
@jimblandy jimblandy deleted the RenderPass-debug-struct branch October 13, 2022 20:43
Comment on lines +239 to +249
f.debug_struct("RenderPass")
.field("encoder_id", &self.parent_id)
.field("color_targets", &self.color_targets)
.field("depth_stencil_target", &self.depth_stencil_target)
.field("command count", &self.base.commands.len())
.field("dynamic offset count", &self.base.dynamic_offsets.len())
.field(
"push constant u32 count",
&self.base.push_constant_data.len(),
)
.finish()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought: Would destructuring before the debug_struct call here be helpful for keeping fields in sync? That way, the compiler can provide warnings when new fields are added, at the least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants