Cargo clippy

This commit is contained in:
Aloke Desai 2024-09-10 21:04:12 -04:00
parent fb5c957eab
commit c321520a82
4 changed files with 15 additions and 16 deletions

View File

@ -5627,7 +5627,7 @@ pub enum SurfaceStatus {
/// The surface under the swap chain is lost.
Lost,
/// The surface status is not known.
Unknown
Unknown,
}
/// Nanosecond timestamp used by the presentation engine.

View File

@ -115,7 +115,7 @@ impl Surface<'_> {
SurfaceStatus::Timeout => return Err(SurfaceError::Timeout),
SurfaceStatus::Outdated => return Err(SurfaceError::Outdated),
SurfaceStatus::Lost => return Err(SurfaceError::Lost),
SurfaceStatus::Unknown => return Err(SurfaceError::Other)
SurfaceStatus::Unknown => return Err(SurfaceError::Other),
};
let guard = self.config.lock();

View File

@ -68,7 +68,7 @@ pub enum SurfaceError {
/// There is no more memory left to allocate a new frame.
OutOfMemory,
/// Acquiring a texture failed for an unknown reason
Other
Other,
}
static_assertions::assert_impl_all!(SurfaceError: Send, Sync);

View File

@ -443,7 +443,7 @@ pub struct Surface {
configured_device: Mutex<Option<wgc::id::DeviceId>>,
/// The error sink with which to report errors.
/// `None` if the surface has not been configured.
error_sink: Mutex<Option<ErrorSink>>
error_sink: Mutex<Option<ErrorSink>>,
}
#[derive(Debug)]
@ -741,19 +741,18 @@ impl crate::Context for ContextWgpuCore {
},
)
}
Err(err) => {
match surface_data.error_sink.lock().as_ref() {
Some(error_sink) => {
self.handle_error_nolabel(error_sink, err, "Surface::get_current_texture_view");
(None, SurfaceStatus::Unknown,
SurfaceOutputDetail {
surface_id: surface_data.id,
})
},
None => {
self.handle_error_fatal(err, "Surface::get_current_texture_view")
}
Err(err) => match surface_data.error_sink.lock().as_ref() {
Some(error_sink) => {
self.handle_error_nolabel(error_sink, err, "Surface::get_current_texture_view");
(
None,
SurfaceStatus::Unknown,
SurfaceOutputDetail {
surface_id: surface_data.id,
},
)
}
None => self.handle_error_fatal(err, "Surface::get_current_texture_view"),
},
}
}