From adafde14b097045bcd5ffdffd64ed86f2a19ffd4 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Thu, 25 Apr 2024 22:53:22 +0200 Subject: [PATCH] Merge some related import blocks --- wayland-backend/src/client_api.rs | 6 ++++-- wayland-backend/src/debug.rs | 2 +- wayland-backend/src/protocol.rs | 2 +- wayland-backend/src/rs/client_impl/mod.rs | 3 +-- wayland-backend/src/rs/server_impl/client.rs | 6 ++++-- wayland-backend/src/rs/server_impl/common_poll.rs | 3 +-- wayland-backend/src/rs/server_impl/handle.rs | 6 ++++-- wayland-backend/src/rs/socket.rs | 3 +-- wayland-backend/src/rs/wire.rs | 3 +-- wayland-backend/src/server_api.rs | 6 ++++-- wayland-backend/src/sys/client_impl/mod.rs | 3 +-- wayland-backend/src/sys/server_impl/mod.rs | 3 +-- wayland-client/examples/simple_window.rs | 2 +- wayland-server/src/socket.rs | 5 +---- 14 files changed, 26 insertions(+), 27 deletions(-) diff --git a/wayland-backend/src/client_api.rs b/wayland-backend/src/client_api.rs index a9234b46310..2abc793df2c 100644 --- a/wayland-backend/src/client_api.rs +++ b/wayland-backend/src/client_api.rs @@ -1,8 +1,10 @@ use std::{ any::Any, fmt, - os::unix::io::{BorrowedFd, OwnedFd}, - os::unix::{io::RawFd, net::UnixStream}, + os::unix::{ + io::{BorrowedFd, OwnedFd, RawFd}, + net::UnixStream, + }, sync::Arc, }; diff --git a/wayland-backend/src/debug.rs b/wayland-backend/src/debug.rs index 9c713bf4451..9dddf241ccc 100644 --- a/wayland-backend/src/debug.rs +++ b/wayland-backend/src/debug.rs @@ -2,7 +2,7 @@ use std::{ fmt::Display, - os::unix::prelude::AsRawFd, + os::unix::io::AsRawFd, time::{SystemTime, UNIX_EPOCH}, }; diff --git a/wayland-backend/src/protocol.rs b/wayland-backend/src/protocol.rs index a60f3cf74ae..87b0f50b541 100644 --- a/wayland-backend/src/protocol.rs +++ b/wayland-backend/src/protocol.rs @@ -1,6 +1,6 @@ //! Types and utilities for manipulating the Wayland protocol -use std::{ffi::CString, os::unix::prelude::AsRawFd}; +use std::{ffi::CString, os::unix::io::AsRawFd}; pub use wayland_sys::common::{wl_argument, wl_interface, wl_message}; diff --git a/wayland-backend/src/rs/client_impl/mod.rs b/wayland-backend/src/rs/client_impl/mod.rs index 2e1f841a373..2c833d0d9a0 100644 --- a/wayland-backend/src/rs/client_impl/mod.rs +++ b/wayland-backend/src/rs/client_impl/mod.rs @@ -2,9 +2,8 @@ use std::{ fmt, - os::unix::io::{BorrowedFd, OwnedFd}, os::unix::{ - io::{AsRawFd, RawFd}, + io::{AsRawFd, BorrowedFd, OwnedFd, RawFd}, net::UnixStream, }, sync::{Arc, Condvar, Mutex, MutexGuard, Weak}, diff --git a/wayland-backend/src/rs/server_impl/client.rs b/wayland-backend/src/rs/server_impl/client.rs index 44c216db6de..3ef1a652aec 100644 --- a/wayland-backend/src/rs/server_impl/client.rs +++ b/wayland-backend/src/rs/server_impl/client.rs @@ -1,7 +1,9 @@ use std::{ ffi::CString, - os::unix::io::{AsFd, BorrowedFd, OwnedFd}, - os::unix::{io::RawFd, net::UnixStream}, + os::unix::{ + io::{AsFd, BorrowedFd, OwnedFd, RawFd}, + net::UnixStream, + }, sync::Arc, }; diff --git a/wayland-backend/src/rs/server_impl/common_poll.rs b/wayland-backend/src/rs/server_impl/common_poll.rs index e9ea984095a..d459d8076ce 100644 --- a/wayland-backend/src/rs/server_impl/common_poll.rs +++ b/wayland-backend/src/rs/server_impl/common_poll.rs @@ -1,6 +1,5 @@ use std::{ - os::unix::io::AsRawFd, - os::unix::io::{BorrowedFd, OwnedFd}, + os::unix::io::{AsRawFd, BorrowedFd, OwnedFd}, sync::{Arc, Mutex}, }; diff --git a/wayland-backend/src/rs/server_impl/handle.rs b/wayland-backend/src/rs/server_impl/handle.rs index 7eb284acb91..7d1cff1ce08 100644 --- a/wayland-backend/src/rs/server_impl/handle.rs +++ b/wayland-backend/src/rs/server_impl/handle.rs @@ -1,7 +1,9 @@ use std::{ ffi::CString, - os::unix::io::OwnedFd, - os::unix::{io::RawFd, net::UnixStream}, + os::unix::{ + io::{OwnedFd, RawFd}, + net::UnixStream, + }, sync::{Arc, Mutex, Weak}, }; diff --git a/wayland-backend/src/rs/socket.rs b/wayland-backend/src/rs/socket.rs index c11607475fe..94170d233ae 100644 --- a/wayland-backend/src/rs/socket.rs +++ b/wayland-backend/src/rs/socket.rs @@ -333,8 +333,7 @@ mod tests { use crate::protocol::{AllowNull, Argument, ArgumentType, Message}; use std::ffi::CString; - use std::os::unix::io::BorrowedFd; - use std::os::unix::prelude::IntoRawFd; + use std::os::unix::io::IntoRawFd; use smallvec::smallvec; diff --git a/wayland-backend/src/rs/wire.rs b/wayland-backend/src/rs/wire.rs index 76dddd7b265..b42c19559df 100644 --- a/wayland-backend/src/rs/wire.rs +++ b/wayland-backend/src/rs/wire.rs @@ -2,8 +2,7 @@ use std::collections::VecDeque; use std::ffi::CStr; -use std::os::unix::io::RawFd; -use std::os::unix::io::{BorrowedFd, OwnedFd}; +use std::os::unix::io::{BorrowedFd, OwnedFd, RawFd}; use crate::protocol::{Argument, ArgumentType, Message}; diff --git a/wayland-backend/src/server_api.rs b/wayland-backend/src/server_api.rs index c52348ae5f2..8b8552844ad 100644 --- a/wayland-backend/src/server_api.rs +++ b/wayland-backend/src/server_api.rs @@ -1,8 +1,10 @@ use std::{ ffi::CString, fmt, - os::unix::io::{BorrowedFd, OwnedFd}, - os::unix::{io::RawFd, net::UnixStream}, + os::unix::{ + io::{BorrowedFd, OwnedFd, RawFd}, + net::UnixStream, + }, sync::Arc, }; diff --git a/wayland-backend/src/sys/client_impl/mod.rs b/wayland-backend/src/sys/client_impl/mod.rs index dfd33703247..60c8898b8e5 100644 --- a/wayland-backend/src/sys/client_impl/mod.rs +++ b/wayland-backend/src/sys/client_impl/mod.rs @@ -4,9 +4,8 @@ use std::{ collections::HashSet, ffi::CStr, os::raw::{c_int, c_void}, - os::unix::io::{BorrowedFd, OwnedFd}, os::unix::{ - io::{FromRawFd, IntoRawFd, RawFd}, + io::{BorrowedFd, FromRawFd, IntoRawFd, OwnedFd, RawFd}, net::UnixStream, }, sync::{ diff --git a/wayland-backend/src/sys/server_impl/mod.rs b/wayland-backend/src/sys/server_impl/mod.rs index f0d9c7c545f..0b90201f46a 100644 --- a/wayland-backend/src/sys/server_impl/mod.rs +++ b/wayland-backend/src/sys/server_impl/mod.rs @@ -3,9 +3,8 @@ use std::{ ffi::{CStr, CString}, os::raw::{c_int, c_void}, - os::unix::io::{BorrowedFd, OwnedFd}, os::unix::{ - io::{FromRawFd, IntoRawFd, RawFd}, + io::{BorrowedFd, FromRawFd, IntoRawFd, OwnedFd, RawFd}, net::UnixStream, }, sync::{ diff --git a/wayland-client/examples/simple_window.rs b/wayland-client/examples/simple_window.rs index d5269e8e7d3..9e3eb4ab312 100644 --- a/wayland-client/examples/simple_window.rs +++ b/wayland-client/examples/simple_window.rs @@ -1,4 +1,4 @@ -use std::{fs::File, os::unix::prelude::AsFd}; +use std::{fs::File, os::unix::io::AsFd}; use wayland_client::{ delegate_noop, diff --git a/wayland-server/src/socket.rs b/wayland-server/src/socket.rs index 37694f766a1..19ba77e38fc 100644 --- a/wayland-server/src/socket.rs +++ b/wayland-server/src/socket.rs @@ -5,10 +5,7 @@ use std::{ io, os::unix::{ fs::OpenOptionsExt, - io::{AsFd, BorrowedFd}, - }, - os::unix::{ - io::{AsRawFd, RawFd}, + io::{AsFd, AsRawFd, BorrowedFd, RawFd}, net::{UnixListener, UnixStream}, prelude::MetadataExt, },