chore: Prepare for Rust edition bump to 2024 (without autofix) (#27791)

Successor to #27779 - in this PR I've applied changes manually, without
futzing with if let lifetimes at all.

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz
2025-03-31 20:10:36 +02:00
committed by GitHub
parent d51aa2ffb0
commit 0729d24d77
162 changed files with 2333 additions and 1937 deletions
+1 -1
View File
@@ -632,7 +632,7 @@ pub(super) fn get_xkb_compose_state(cx: &xkb::Context) -> Option<xkb::compose::S
#[cfg(any(feature = "wayland", feature = "x11"))]
pub(super) unsafe fn read_fd(mut fd: filedescriptor::FileDescriptor) -> Result<Vec<u8>> {
let mut file = File::from_raw_fd(fd.as_raw_fd());
let mut file = unsafe { File::from_raw_fd(fd.as_raw_fd()) };
let mut buffer = Vec::new();
file.read_to_end(&mut buffer)?;
Ok(buffer)
@@ -256,7 +256,7 @@ impl Clipboard {
}
Ok(n) => written += n,
Err(err) if err.kind() == ErrorKind::WouldBlock => {
break Ok(PostAction::Continue)
break Ok(PostAction::Continue);
}
Err(_) => break Ok(PostAction::Remove),
}
+20 -5
View File
@@ -186,12 +186,15 @@ fn find_visuals(xcb: &XCBConnection, screen_index: usize) -> VisualSet {
colormap: 0,
depth: depth_info.depth,
};
log::debug!("Visual id: {}, class: {:?}, depth: {}, bits_per_value: {}, masks: 0x{:x} 0x{:x} 0x{:x}",
log::debug!(
"Visual id: {}, class: {:?}, depth: {}, bits_per_value: {}, masks: 0x{:x} 0x{:x} 0x{:x}",
visual_type.visual_id,
visual_type.class,
depth_info.depth,
visual_type.bits_per_rgb_value,
visual_type.red_mask, visual_type.green_mask, visual_type.blue_mask,
visual_type.red_mask,
visual_type.green_mask,
visual_type.blue_mask,
);
if (
@@ -409,15 +412,27 @@ impl X11WindowState {
let mut bounds = params.bounds.to_device_pixels(scale_factor);
if bounds.size.width.0 == 0 || bounds.size.height.0 == 0 {
log::warn!("Window bounds contain a zero value. height={}, width={}. Falling back to defaults.", bounds.size.height.0, bounds.size.width.0);
log::warn!(
"Window bounds contain a zero value. height={}, width={}. Falling back to defaults.",
bounds.size.height.0,
bounds.size.width.0
);
bounds.size.width = 800.into();
bounds.size.height = 600.into();
}
check_reply(
|| {
format!("X11 CreateWindow failed. depth: {}, x_window: {}, visual_set.root: {}, bounds.origin.x.0: {}, bounds.origin.y.0: {}, bounds.size.width.0: {}, bounds.size.height.0: {}",
visual.depth, x_window, visual_set.root, bounds.origin.x.0 + 2, bounds.origin.y.0, bounds.size.width.0, bounds.size.height.0)
format!(
"X11 CreateWindow failed. depth: {}, x_window: {}, visual_set.root: {}, bounds.origin.x.0: {}, bounds.origin.y.0: {}, bounds.size.width.0: {}, bounds.size.height.0: {}",
visual.depth,
x_window,
visual_set.root,
bounds.origin.x.0 + 2,
bounds.origin.y.0,
bounds.size.width.0,
bounds.size.height.0
)
},
xcb.create_window(
visual.depth,