Closed Swoorup closed 3 months ago
🐞Mistake | 🤪Typo | 🚨Security | 🚀Performance | 💪Best Practices | 📖Readability | ❓Others |
---|---|---|---|---|---|---|
0 | 0 | 0 | 0 | 0 | 1 | 0 |
WgpuBindGroup{N}EntryCollection
and WgpuBindGroup{N}EntryCollectionParams
structs.ID | Type | Details | Severity | Confidence |
---|---|---|---|---|
1 | 📖Readability | The pub use self::bind_groups::*; statement is repeated multiple times and may be redundant. |
🟡Low | 🟡Low |
pub use self::bind_groups::*;
StatementThe pub use self::bind_groups::*;
statement is repeated in multiple places, which can be redundant and affect readability.
File Path: example/src/shader_bindings.rs
, wgsl_bindgen/src/generate/bind_group/mod.rs
, wgsl_bindgen/tests/output/bindgen_bevy.expected.rs
, wgsl_bindgen/tests/output/bindgen_main.expected.rs
, wgsl_bindgen/tests/output/bindgen_minimal.expected.rs
, wgsl_bindgen/tests/output/bindgen_padding.expected.rs
Lines of Code:
+ pub use self::bind_groups::*;
Suggested Fix:
Remove the redundant pub use self::bind_groups::*;
statements from the files where they are not necessary.
Code:
diff --git a/example/src/shader_bindings.rs b/example/src/shader_bindings.rs
index a33bdb8..new_index 100644
--- a/example/src/shader_bindings.rs
+++ b/example/src/shader_bindings.rs
@@ -892,7 +892,6 @@ pub mod testbed {
}
}
}
- pub use self::bind_groups::*;
pub fn set_bind_groups<'a>(
pass: &mut wgpu::ComputePass<'a>,
bind_group0: &'a bind_groups::WgpuBindGroup0,
@@ -1439,7 +1438,6 @@ pub mod triangle {
}
}
}
- pub use self::bind_groups::*;
pub fn set_bind_groups<'a>(
pass: &mut wgpu::RenderPass<'a>,
bind_group0: &'a bind_groups::WgpuBindGroup0,
Explanation:
The pub use self::bind_groups::*;
statement is used to re-export the contents of the bind_groups
module. However, if this statement is repeated in multiple places, it can be redundant and affect readability. Removing the redundant statements will improve the overall readability of the code.
Overall, the code quality and style are good. The refactoring improves the structure and readability of the bind group entry creation process. However, the repeated pub use self::bind_groups::*;
statements should be addressed to further enhance readability.
Summon me to re-review when updated! Yours, Gooroo.dev React or reply to let me know your thoughts!
Bindgroups
WgpuBindGroupLayout0
toWgpuBindGroup0EntryCollection
.WgpuBindGroup0EntryCollectionParams