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,21 +56,18 @@ impl Kind {
/// Activate/Deactivate this window
pub fn set_activated(&self, active: bool) {
match *self {
Kind::Xdg(ref t) => {
let changed = t.with_pending_state(|state| {
if active {
state.states.set(xdg_toplevel::State::Activated)
} else {
state.states.unset(xdg_toplevel::State::Activated)
}
});
if let Ok(true) = changed {
t.send_configure();
if let Kind::Xdg(ref t) = self {
let changed = t.with_pending_state(|state| {
if active {
state.states.set(xdg_toplevel::State::Activated)
} else {
state.states.unset(xdg_toplevel::State::Activated)
}
});
if let Ok(true) = changed {
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)
#[allow(clippy::too_many_arguments)]
pub fn build_request<'a>(
&self,
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 dmabuf = match maybe_buffer {
Some(buf) => buf.clone(),
Some(buf) => buf,
None => {
let dmabuf = slot.export()?;
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.
///
/// 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 {
let addr = CString::new(symbol.as_bytes()).unwrap();
let addr = addr.as_ptr();