chore: appease clippy (#4471)

This commit is contained in:
Mads Marquart authored and Kirill Chibisov committed 2026-09-05 03:18:46 +09:00
1 parent a992706c9e
commit 4ccbb97fd3
1 file changed
+7 -2
+7 -2
View File
@@ -50,8 +50,13 @@ impl ImeInner {
}
pub unsafe fn close_im_if_necessary(&self) -> Result<bool, XError> {
if !self.is_destroyed && self.im.is_some() {
unsafe { close_im(&self.xconn, self.im.as_ref().unwrap().im) }.map(|_| true)
if !self.is_destroyed {
if let Some(im) = &self.im {
unsafe { close_im(&self.xconn, im.im) }?;
Ok(true)
} else {
Ok(false)
}
} else {
Ok(false)
}