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

AllocatorVisualizer could/should implement Default #103

Open
RedBreadcat opened this issue Mar 13, 2022 · 1 comment
Open

AllocatorVisualizer could/should implement Default #103

RedBreadcat opened this issue Mar 13, 2022 · 1 comment

Comments

@RedBreadcat
Copy link

Hello,
First of all, thank you for the excellent library.

The AllocatorVisualizer struct (both DX12 and Vulkan) are created using the new() function, which notably has no arguments. One might expect it to implement Default for this reason, but it does not.
There's a clippy lint for this: https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
The Rust API guidelines recommend the same: https://rust-lang.github.io/api-guidelines/interoperability.html

@MarijnS95
Copy link
Member

MarijnS95 commented Mar 14, 2022

Surprisingly src/{d3d12,vulkan}/visualizer.rs allow this lint at the top:

#![allow(clippy::new_without_default)]

#![allow(clippy::new_without_default)]

Perhaps those should be removed and the resulting clippy lints fixed? I don't see a compelling reason to omit this lint - feel free to open a PR!

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

No branches or pull requests

2 participants