Clippy fixes

This commit is contained in:
Victor Berger 2021-06-23 22:52:49 +02:00 committed by Victor Berger
parent 053bc98faa
commit da5c814555
4 changed files with 16 additions and 14 deletions

View File

@ -56,8 +56,7 @@ impl Kind {
/// Activate/Deactivate this window /// Activate/Deactivate this window
pub fn set_activated(&self, active: bool) { pub fn set_activated(&self, active: bool) {
match *self { if let Kind::Xdg(ref t) = self {
Kind::Xdg(ref t) => {
let changed = t.with_pending_state(|state| { let changed = t.with_pending_state(|state| {
if active { if active {
state.states.set(xdg_toplevel::State::Activated) state.states.set(xdg_toplevel::State::Activated)
@ -69,8 +68,6 @@ impl Kind {
t.send_configure(); t.send_configure();
} }
} }
_ => {}
};
} }
} }

View File

@ -752,6 +752,7 @@ impl<A: AsRawFd + 'static> AtomicDrmSurface<A> {
} }
// If a mode is set a matching blob needs to be set (the inverse is not true) // If a mode is set a matching blob needs to be set (the inverse is not true)
#[allow(clippy::too_many_arguments)]
pub fn build_request<'a>( pub fn build_request<'a>(
&self, &self,
new_connectors: &mut dyn Iterator<Item = &connector::Handle>, new_connectors: &mut dyn Iterator<Item = &connector::Handle>,

View File

@ -313,7 +313,7 @@ where
let maybe_buffer = slot.userdata().as_ref().map(|(buf, _)| buf.clone()); let maybe_buffer = slot.userdata().as_ref().map(|(buf, _)| buf.clone());
let dmabuf = match maybe_buffer { let dmabuf = match maybe_buffer {
Some(buf) => buf.clone(), Some(buf) => buf,
None => { None => {
let dmabuf = slot.export()?; let dmabuf = slot.export()?;
let fb_handle = attach_framebuffer(&self.drm, &*slot)?; let fb_handle = attach_framebuffer(&self.drm, &*slot)?;

View File

@ -70,6 +70,10 @@ impl ::std::error::Error for EglExtensionNotSupportedError {}
/// Returns the address of an OpenGL function. /// Returns the address of an OpenGL function.
/// ///
/// Result is independent of displays and does not guarantee an extension is actually supported at runtime. /// Result is independent of displays and does not guarantee an extension is actually supported at runtime.
///
/// # Safety
///
/// This function should only be invoked while an EGL context is active.
pub unsafe fn get_proc_address(symbol: &str) -> *const c_void { pub unsafe fn get_proc_address(symbol: &str) -> *const c_void {
let addr = CString::new(symbol.as_bytes()).unwrap(); let addr = CString::new(symbol.as_bytes()).unwrap();
let addr = addr.as_ptr(); let addr = addr.as_ptr();