You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This makes it hard to do things like Arc::try_unwrap(...) on a StaticSoundData. The guidelines say all types should implement Debug (except for rare exceptions) but it looks like the ringbuf dependency does not, which makes it hard to fix in kira.
Is there any opinion between these options?
Manually implement Debug, formatting the obvious fields (and optionally providing something nice for things like consumer)
Upgrade the ringbuf dependency (it is behind) and open an issue in their repo; wait for a fix and then auto-derive Debug
Use the new-type pattern to wrap ringbuf types and provide a generic Debug implementation inside kira
The text was updated successfully, but these errors were encountered:
The main reason I haven't derived Debug for StaticSoundData is because it contains a Vec which will typically contain a very large number of Frames - you probably don't want all that in your terminal. I was thinking of adding a manual Debug impl that displays something like frames: [2392 frames]. I'm not sure if there's a standard for how to display very long Vecs.
As for the other types, I'd probably use a manual Debug impl for anything containing a ringbuf type that doesn't implement Debug. That being said, you should open an issue in the ringbuf repo is you feel strongly about it.
On a side note, why do you need to wrap a StaticSoundData in an Arc? The frames of a StaticSoundData are already in an Arc.
The frames: [2392 frames] idea sounds clear and avoids the issue you're predicting, yes a terminal full of stuff would be 😔.
I was playing around with Arc<Mutex<HashMap<String, StaticSoundData>>> with sounds being loaded on multiple threads; at the end I wanted the HashMap out of that mess.
This makes it hard to do things like
Arc::try_unwrap(...)
on aStaticSoundData
. The guidelines say all types should implementDebug
(except for rare exceptions) but it looks like theringbuf
dependency does not, which makes it hard to fix inkira
.Is there any opinion between these options?
Debug
, formatting the obvious fields (and optionally providing something nice for things likeconsumer
)ringbuf
dependency (it is behind) and open an issue in their repo; wait for a fix and then auto-deriveDebug
ringbuf
types and provide a genericDebug
implementation insidekira
The text was updated successfully, but these errors were encountered: