twilight icon indicating copy to clipboard operation
twilight copied to clipboard

Use correct atomic sizes for volume level in lavalink

Open BlackHoleFox opened this issue 3 years ago • 0 comments

On main, twilight-lavalink truncates the volume level received from an event down to a u16. Given the other big fields in the player struct, we should just use a Atomic type with the matching size instead. This also ducks edge cases with underflow/overflow.

https://github.com/twilight-rs/twilight/blob/77b0314100f2b03c8a954950606bb5738c58ee8f/lavalink/src/player.rs#L148-L151

First noticed in this PR diff.

BlackHoleFox avatar Jun 08 '22 06:06 BlackHoleFox