mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 00:03:29 +00:00
Cargo clippy
This commit is contained in:
parent
fb5c957eab
commit
c321520a82
@ -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.
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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"),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user