1
0
Fork 0
forked from wry/wry

all: set rust edition to 2024

This commit is contained in:
Julian Orth 2025-02-21 10:44:29 +01:00
parent 02a18f620b
commit 3338909170
515 changed files with 1225 additions and 1187 deletions

View file

@ -1,5 +1,5 @@
use {
crate::utils::opaque::{opaque, Opaque, OpaqueError, OPAQUE_LEN},
crate::utils::opaque::{OPAQUE_LEN, Opaque, OpaqueError, opaque},
arrayvec::ArrayString,
std::{
fmt::{Display, Formatter},

View file

@ -3,7 +3,7 @@ use {
io_uring::IoUring,
utils::{
buf::Buf,
buffd::{BufFdError, BUF_SIZE, MAX_IN_FD},
buffd::{BUF_SIZE, BufFdError, MAX_IN_FD},
},
},
smallvec::SmallVec,

View file

@ -4,7 +4,7 @@ use {
time::Time,
utils::{
buf::Buf,
buffd::{BufFdError, BUF_SIZE},
buffd::{BUF_SIZE, BufFdError},
oserror::OsError,
},
},
@ -13,7 +13,7 @@ use {
mem::{self},
rc::Rc,
},
uapi::{c, OwnedFd},
uapi::{OwnedFd, c},
};
pub(super) const OUT_BUF_SIZE: usize = 2 * BUF_SIZE;
@ -151,7 +151,7 @@ impl BufFdOut {
match res {
Ok(n) => read_pos += n,
Err(IoUringError::OsError(OsError(c::ECONNRESET))) => {
return Err(BufFdError::Closed)
return Err(BufFdError::Closed);
}
Err(e) => return Err(BufFdError::Io(e)),
}

View file

@ -1,7 +1,7 @@
use {
crate::{
ei::ei_object::EiObjectId,
utils::buffd::buf_out::{MsgFds, OutBuffer, OutBufferMeta, OUT_BUF_SIZE},
utils::buffd::buf_out::{MsgFds, OUT_BUF_SIZE, OutBuffer, OutBufferMeta},
},
std::{mem, rc::Rc},
uapi::OwnedFd,

View file

@ -2,7 +2,7 @@ use {
crate::{
fixed::Fixed,
object::ObjectId,
utils::buffd::buf_out::{MsgFds, OutBuffer, OutBufferMeta, OUT_BUF_SIZE},
utils::buffd::buf_out::{MsgFds, OUT_BUF_SIZE, OutBuffer, OutBufferMeta},
},
std::{mem, rc::Rc},
uapi::{OwnedFd, Packed},

View file

@ -13,7 +13,7 @@ use {
rc::Rc,
},
thiserror::Error,
uapi::{c, OwnedFd},
uapi::{OwnedFd, c},
};
#[derive(Debug, Error)]

View file

@ -1,6 +1,6 @@
use {
crate::forker::ForkerError,
uapi::{c, OwnedFd},
uapi::{OwnedFd, c},
};
#[derive(Default, Copy, Clone)]

View file

@ -43,7 +43,9 @@ impl FdCloser {
self.cv.notify_all();
}
Err(_e) => {
log::warn!("Could not close file descriptor in separate thread. There are still references.");
log::warn!(
"Could not close file descriptor in separate thread. There are still references."
);
}
}
}

View file

@ -1,7 +1,7 @@
use {
crate::utils::oserror::OsError,
smallvec::{smallvec_inline, SmallVec},
uapi::{c, Errno},
smallvec::{SmallVec, smallvec_inline},
uapi::{Errno, c},
};
#[cfg_attr(not(feature = "it"), expect(dead_code))]

View file

@ -1,7 +1,7 @@
use {
arrayvec::ArrayString,
rand::{thread_rng, Rng},
serde::{de, Deserialize, Deserializer, Serialize, Serializer},
rand::{Rng, thread_rng},
serde::{Deserialize, Deserializer, Serialize, Serializer, de},
std::{
fmt::{Debug, Display, Formatter},
num::ParseIntError,

View file

@ -4,7 +4,10 @@ use {
error::Error,
fmt::{Display, Formatter},
},
uapi::{c, c::c_int, Errno},
uapi::{
Errno,
c::{self, c_int},
},
};
static ERRORS: Lazy<&'static [Option<&'static str>]> = Lazy::new(|| {

View file

@ -1,7 +1,7 @@
use {
crate::utils::{errorfmt::ErrorFmt, oserror::OsError},
bstr::ByteSlice,
uapi::{c, OwnedFd},
uapi::{OwnedFd, c},
};
pub struct PidInfo {

View file

@ -1,4 +1,4 @@
use uapi::{c, IntoUstr};
use uapi::{IntoUstr, c};
pub fn set_process_name(name: &str) {
unsafe {

View file

@ -2,8 +2,8 @@ use {
crate::{
backend::AXIS_120,
ifs::wl_seat::{
wl_pointer::{PendingScroll, VERTICAL_SCROLL},
PX_PER_SCROLL,
wl_pointer::{PendingScroll, VERTICAL_SCROLL},
},
},
std::cell::Cell,
@ -38,10 +38,6 @@ impl Scroller {
self.v120.set(0);
self.px.set(0.0);
}
if n != 0 {
Some(n)
} else {
None
}
if n != 0 { Some(n) } else { None }
}
}

View file

@ -15,11 +15,7 @@ impl ThresholdCounter {
}
pub fn adj(&self, inc: bool) -> bool {
if inc {
self.inc()
} else {
self.dec()
}
if inc { self.inc() } else { self.dec() }
}
pub fn active(&self) -> bool {

View file

@ -5,7 +5,7 @@ use {
},
std::{cell::RefCell, rc::Rc, time::Duration},
thiserror::Error,
uapi::{c, OwnedFd},
uapi::{OwnedFd, c},
};
#[derive(Debug, Error)]

View file

@ -1,5 +1,5 @@
use {
crate::utils::opaque::{opaque, Opaque, OpaqueError, OPAQUE_LEN},
crate::utils::opaque::{OPAQUE_LEN, Opaque, OpaqueError, opaque},
arrayvec::ArrayString,
std::{
fmt::{Display, Formatter},

View file

@ -1,11 +1,11 @@
use {
crate::ifs::wl_output::{
TF_180, TF_270, TF_90, TF_FLIPPED, TF_FLIPPED_180, TF_FLIPPED_270, TF_FLIPPED_90, TF_NORMAL,
TF_90, TF_180, TF_270, TF_FLIPPED, TF_FLIPPED_90, TF_FLIPPED_180, TF_FLIPPED_270, TF_NORMAL,
},
jay_config::video::{
Transform,
Transform::{
Flip, FlipRotate180, FlipRotate270, FlipRotate90, None, Rotate180, Rotate270, Rotate90,
Flip, FlipRotate90, FlipRotate180, FlipRotate270, None, Rotate90, Rotate180, Rotate270,
},
},
};