mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-24 00:11:11 +01:00
fix clippy warnings and errors (#4205)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
This commit is contained in:
1 parent
651299b870
commit
a5b9ebb3c9
3 files changed
+9
-8
No files matched your search
@@ -862,6 +862,7 @@ By @jimblandy in [#3254](https://github.com/gfx-rs/wgpu/pull/3254).
|
||||
- Move `ResourceMetadata` into its own module. By @jimblandy in [#3213](https://github.com/gfx-rs/wgpu/pull/3213)
|
||||
- Add WebAssembly testing infrastructure. By @haraldreingruber in [#3238](https://github.com/gfx-rs/wgpu/pull/3238)
|
||||
- Error message when you forget to use cargo-nextest. By @cwfitzgerald in [#3293](https://github.com/gfx-rs/wgpu/pull/3293)
|
||||
- Fix all suggestions from `cargo clippy`
|
||||
|
||||
## wgpu-0.14.2 (2022-11-28)
|
||||
|
||||
|
||||
+1
-1
@@ -122,7 +122,7 @@ impl<T> Copy for Id<T> {}
|
||||
|
||||
impl<T> Clone for Id<T> {
|
||||
fn clone(&self) -> Self {
|
||||
Self(self.0, PhantomData)
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use glow::HasContext;
|
||||
use parking_lot::{Mutex, MutexGuard};
|
||||
|
||||
use std::{ffi, os::raw, ptr, sync::Arc, time::Duration};
|
||||
use std::{ffi, os::raw, ptr, rc::Rc, sync::Arc, time::Duration};
|
||||
|
||||
/// The amount of time to wait while trying to obtain a lock to the adapter context
|
||||
const CONTEXT_LOCK_TIMEOUT_SECS: u64 = 1;
|
||||
@@ -683,7 +683,7 @@ enum WindowKind {
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
struct WindowSystemInterface {
|
||||
display_owner: Option<Arc<DisplayOwner>>,
|
||||
display_owner: Option<Rc<DisplayOwner>>,
|
||||
kind: WindowKind,
|
||||
}
|
||||
|
||||
@@ -798,7 +798,7 @@ impl crate::Instance<super::Api> for Instance {
|
||||
)
|
||||
}
|
||||
.unwrap();
|
||||
(display, Some(Arc::new(library)), WindowKind::Wayland)
|
||||
(display, Some(Rc::new(library)), WindowKind::Wayland)
|
||||
} else if let (Some(display_owner), Some(egl)) = (x11_display_library, egl1_5) {
|
||||
log::info!("Using X11 platform");
|
||||
let display_attributes = [khronos_egl::ATTRIB_NONE];
|
||||
@@ -810,7 +810,7 @@ impl crate::Instance<super::Api> for Instance {
|
||||
)
|
||||
}
|
||||
.unwrap();
|
||||
(display, Some(Arc::new(display_owner)), WindowKind::X11)
|
||||
(display, Some(Rc::new(display_owner)), WindowKind::X11)
|
||||
} else if let (Some(display_owner), Some(egl)) = (angle_x11_display_library, egl1_5) {
|
||||
log::info!("Using Angle platform with X11");
|
||||
let display_attributes = [
|
||||
@@ -828,7 +828,7 @@ impl crate::Instance<super::Api> for Instance {
|
||||
)
|
||||
}
|
||||
.unwrap();
|
||||
(display, Some(Arc::new(display_owner)), WindowKind::AngleX11)
|
||||
(display, Some(Rc::new(display_owner)), WindowKind::AngleX11)
|
||||
} else if client_ext_str.contains("EGL_MESA_platform_surfaceless") {
|
||||
log::info!("No windowing system present. Using surfaceless platform");
|
||||
let egl = egl1_5.expect("Failed to get EGL 1.5 for surfaceless");
|
||||
@@ -840,6 +840,7 @@ impl crate::Instance<super::Api> for Instance {
|
||||
)
|
||||
}
|
||||
.unwrap();
|
||||
|
||||
(display, None, WindowKind::Unknown)
|
||||
} else {
|
||||
log::info!("EGL_MESA_platform_surfaceless not available. Using default platform");
|
||||
@@ -1209,8 +1210,7 @@ impl crate::Surface<super::Api> for Surface {
|
||||
let library = &self.wsi.display_owner.as_ref().unwrap().library;
|
||||
let wl_egl_window_create: libloading::Symbol<WlEglWindowCreateFun> =
|
||||
unsafe { library.get(b"wl_egl_window_create") }.unwrap();
|
||||
let window = unsafe { wl_egl_window_create(handle.surface, 640, 480) }
|
||||
as *mut _ as *mut std::ffi::c_void;
|
||||
let window = unsafe { wl_egl_window_create(handle.surface, 640, 480) };
|
||||
wl_window = Some(window);
|
||||
window
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user