virtio_gpu.rs: Allow mutation in AssociatedScanouts methods

Corrected the AssociatedScanouts methods to remove the
const keyword and allow them to be mutable functions

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
This commit is contained in:
Dorinda Bassey 2025-08-25 16:46:20 +02:00 committed by Stefano Garzarella
parent 1a1d1e2685
commit 852751b76a

View File

@ -262,12 +262,14 @@ pub struct FenceState {
struct AssociatedScanouts(u32);
impl AssociatedScanouts {
const fn enable(&mut self, scanout_id: u32) {
#[allow(clippy::missing_const_for_fn)]
fn enable(&mut self, scanout_id: u32) {
self.0 |= 1 << scanout_id;
}
const fn disable(&mut self, scanout_id: u32) {
self.0 ^= 1 << scanout_id;
#[allow(clippy::missing_const_for_fn)]
fn disable(&mut self, scanout_id: u32) {
self.0 &= !(1 << scanout_id);
}
const fn has_any_enabled(self) -> bool {