webrender_traits: update closure in with_front_buffer to FnOnce (#32946)

Signed-off-by: Wu Wayne <yuweiwu@pm.me>
This commit is contained in:
Ngo Iok Ui (Wu Yu Wei) 2024-08-06 15:06:21 +09:00 committed by GitHub
parent 23df681479
commit 3f339d6856
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -169,7 +169,7 @@ impl RenderingContext {
/// Invoke a closure with the surface associated with the current front buffer.
/// This can be used to create a surfman::SurfaceTexture to blit elsewhere.
pub fn with_front_buffer<F: FnMut(&Device, Surface) -> Surface>(&self, mut f: F) {
pub fn with_front_buffer<F: FnOnce(&Device, Surface) -> Surface>(&self, f: F) {
let device = &mut self.0.device.borrow_mut();
let context = &mut self.0.context.borrow_mut();
let surface = device