Swoorup / wgsl-bindgen

Generate typesafe Rust bindings for wgsl shaders in wgpu
https://crates.io/crates/wgsl_bindgen
MIT License
34 stars 7 forks source link

Fix missing cache property #42

Closed MarcelStruckWO closed 3 months ago

MarcelStruckWO commented 3 months ago

Fix #41

gooroo-dev[bot] commented 3 months ago

Please double check the following review of the pull request:

Issues counts

🐞Mistake 🤪Typo 🚨Security 🚀Performance 💪Best Practices 📖Readability ❓Others
0 0 0 0 0 0 0

Changes in the diff

Identified Issues

ID Type Details Severity Confidence
1 💪Best Practices The cache property is set to None without any comments or documentation explaining why. This might lead to confusion for future maintainers. 🟠Medium 🟠Medium

Issue 1: The cache property is set to None without any comments or documentation explaining why.

Explanation

In the following lines of code, the cache property is set to None without any explanation or documentation:

This might lead to confusion for future maintainers who might not understand the reasoning behind this decision.

Code to address the issue

impl<'a> ComputeModuleBuilder<'a> {
    pub fn build(self) -> Result<ComputeModule, wgpu::PipelineCreationError> {
        Ok(ComputeModule {
            module: &module,
            entry_point: #entry_point,
            compilation_options: Default::default(),
            // Cache is set to None to avoid potential issues with stale cache data.
            // This might be revisited in future versions.
            cache: None,
        })
    }
}

Explanation of the fix

The fix adds a comment explaining why the cache property is set to None. This helps future maintainers understand the reasoning behind this decision and can revisit it if needed.

Missing Tests

The current changes do not introduce any new functionality that requires additional tests. The changes are primarily related to setting the cache property to None and updating the version and source hash. Existing tests should cover the functionality adequately.

Summon me to re-review when updated! Yours, Gooroo.dev Your opinion matters! React or reply to share it.

Swoorup commented 3 months ago

Thank you.