chore(rustfmt): use nightly (#2325)

Stable rustfmt lacks a lot of features resulting in worse formatted
code, thus use nightly formatter.
This commit is contained in:
Kirill Chibisov 2024-04-26 19:11:44 +04:00 committed by GitHub
parent 7006c7ceca
commit 7b0c7b6cb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
154 changed files with 3439 additions and 5891 deletions

View file

@ -1,18 +1,15 @@
use std::{
io,
os::raw::*,
path::{Path, PathBuf},
str::Utf8Error,
sync::Arc,
};
use std::io;
use std::os::raw::*;
use std::path::{Path, PathBuf};
use std::str::Utf8Error;
use std::sync::Arc;
use percent_encoding::percent_decode;
use x11rb::protocol::xproto::{self, ConnectionExt};
use super::{
atoms::{AtomName::None as DndNone, *},
util, CookieResultExt, X11Error, XConnection,
};
use super::atoms::AtomName::None as DndNone;
use super::atoms::*;
use super::{util, CookieResultExt, X11Error, XConnection};
#[derive(Debug, Clone, Copy)]
pub enum DndState {
@ -54,13 +51,7 @@ pub struct Dnd {
impl Dnd {
pub fn new(xconn: Arc<XConnection>) -> Result<Self, X11Error> {
Ok(Dnd {
xconn,
version: None,
type_list: None,
source_window: None,
result: None,
})
Ok(Dnd { xconn, version: None, type_list: None, source_window: None, result: None })
}
pub fn reset(&mut self) {
@ -82,13 +73,13 @@ impl Dnd {
DndState::Rejected => (0, atoms[DndNone]),
};
self.xconn
.send_client_msg(
target_window,
target_window,
atoms[XdndStatus] as _,
None,
[this_window, accepted, 0, 0, action as _],
)?
.send_client_msg(target_window, target_window, atoms[XdndStatus] as _, None, [
this_window,
accepted,
0,
0,
action as _,
])?
.ignore_error();
Ok(())
@ -106,13 +97,13 @@ impl Dnd {
DndState::Rejected => (0, atoms[DndNone]),
};
self.xconn
.send_client_msg(
target_window,
target_window,
atoms[XdndFinished] as _,
None,
[this_window, accepted, action as _, 0, 0],
)?
.send_client_msg(target_window, target_window, atoms[XdndFinished] as _, None, [
this_window,
accepted,
action as _,
0,
0,
])?
.ignore_error();
Ok(())
@ -149,8 +140,7 @@ impl Dnd {
window: xproto::Window,
) -> Result<Vec<c_uchar>, util::GetPropertyError> {
let atoms = self.xconn.atoms();
self.xconn
.get_property(window, atoms[XdndSelection], atoms[TextUriList])
self.xconn.get_property(window, atoms[XdndSelection], atoms[TextUriList])
}
pub fn parse_data(&self, data: &mut [c_uchar]) -> Result<Vec<PathBuf>, DndDataParseError> {