Razaekel / noise-rs

Procedural noise generation library for Rust.
Apache License 2.0
854 stars 120 forks source link

`noise::NoiseFn` doesn't implement `Debug` #348

Closed v0x0g closed 5 months ago

v0x0g commented 5 months ago

I have a project where ideally I would like every object to have a Debug implementation. The problem is, I'm using objects that store references/boxes for generic noise functions, and I can't use #[derive(Debug)] because many of these noise structs simply don't implement Debug. My current workaround is to simply use a custom debug impl using derivative to skip those fields, but it's quite annoying and I'd prefer not to need to.

Here are the structs that don't implement it (I think I got them all):

I'd like to propose adding a #[derive(Debug)] attribute to all the implementors of NoiseFn. Ideally we would also add it as a base trait requirement to NoiseFn : Debug, but I'm aware that might be a breaking change for downstream implementors of the crate (so maybe behind a feature flag?).

If you agree, I'd be glad to make a fork and PR for this.