Skip to content

Commit

Permalink
fix clippy warnings and errors (#4205)
Browse files Browse the repository at this point in the history
Co-authored-by: Connor Fitzgerald <[email protected]>
  • Loading branch information
TornaxO7 and cwfitzgerald authored Oct 9, 2023
1 parent 651299b commit a5b9ebb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion wgpu-core/src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
14 changes: 7 additions & 7 deletions wgpu-hal/src/gles/egl.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -683,7 +683,7 @@ enum WindowKind {

#[derive(Clone, Debug)]
struct WindowSystemInterface {
display_owner: Option<Arc<DisplayOwner>>,
display_owner: Option<Rc<DisplayOwner>>,
kind: WindowKind,
}

Expand Down Expand Up @@ -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];
Expand All @@ -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 = [
Expand All @@ -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");
Expand All @@ -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");
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit a5b9ebb

Please sign in to comment.