chore(rustfmt): change imports_granularity to "Module"

Also includes a Zed config.
This commit is contained in:
Vukašin Vojinović 2026-04-28 17:55:23 +02:00 committed by Jeremy Soller
parent 673e4c949b
commit 17cf4485a9
6 changed files with 55 additions and 39 deletions

15
.zed/settings.json Normal file
View file

@ -0,0 +1,15 @@
{
"format_on_save": "on",
"lsp": {
"rust-analyzer": {
"initialization_options": {
"check": {
"command": "clippy",
},
"rustfmt": {
"extraArgs": ["+nightly"],
},
},
},
},
}

View file

@ -4,7 +4,7 @@ use_field_init_shorthand = true
# Unstable formatting options below; remove if you REALLY don't wanna use `cargo +nightly fmt`
format_code_in_doc_comments = true
format_strings = true
imports_granularity = "Crate"
imports_granularity = "Module"
normalize_comments = true
reorder_impl_items = true
wrap_comments = true

View file

@ -1,17 +1,19 @@
// SPDX-License-Identifier: GPL-3.0-only
use color_eyre::eyre::{Result, WrapErr};
use launch_pad::{ProcessManager, process::Process};
use launch_pad::ProcessManager;
use launch_pad::process::Process;
use serde::{Deserialize, Serialize};
use std::{collections::HashMap, os::unix::prelude::*};
use tokio::{
io::AsyncReadExt,
net::{UnixStream, unix::OwnedReadHalf},
sync::{mpsc, oneshot},
task::JoinHandle,
};
use std::collections::HashMap;
use std::os::unix::prelude::*;
use tokio::io::AsyncReadExt;
use tokio::net::UnixStream;
use tokio::net::unix::OwnedReadHalf;
use tokio::sync::{mpsc, oneshot};
use tokio::task::JoinHandle;
use tokio_util::sync::CancellationToken;
use crate::{process::mark_as_not_cloexec, service::SessionRequest};
use crate::process::mark_as_not_cloexec;
use crate::service::SessionRequest;
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "snake_case", tag = "message")]

View file

@ -9,30 +9,32 @@ mod process;
mod service;
mod systemd;
use color_eyre::{Result, eyre::WrapErr};
use launch_pad::{ProcessManager, process::Process};
use color_eyre::Result;
use color_eyre::eyre::WrapErr;
use launch_pad::ProcessManager;
use launch_pad::process::Process;
use service::SessionRequest;
use std::borrow::Cow;
#[cfg(feature = "autostart")]
use std::collections::HashSet;
use std::env;
use std::os::fd::AsRawFd;
#[cfg(feature = "autostart")]
use std::path::PathBuf;
#[cfg(feature = "autostart")]
use std::process::{Command, Stdio};
use std::{borrow::Cow, env, os::fd::AsRawFd, sync::Arc};
use std::sync::Arc;
#[cfg(feature = "systemd")]
use systemd::{get_systemd_env, is_systemd_used, spawn_scope};
use tokio::{
signal::unix::{SignalKind, signal},
sync::{
Mutex,
mpsc::{Receiver, Sender},
oneshot,
},
time::Duration,
};
use tokio::signal::unix::{SignalKind, signal};
use tokio::sync::mpsc::{Receiver, Sender};
use tokio::sync::{Mutex, oneshot};
use tokio::time::Duration;
use tokio_util::sync::CancellationToken;
use tracing::{Instrument, metadata::LevelFilter};
use tracing_subscriber::{EnvFilter, fmt, prelude::*};
use tracing::Instrument;
use tracing::metadata::LevelFilter;
use tracing_subscriber::prelude::*;
use tracing_subscriber::{EnvFilter, fmt};
use crate::notifications::{
DAEMON_NOTIFICATIONS_FD, PANEL_NOTIFICATIONS_FD, notifications_process,

View file

@ -1,10 +1,11 @@
use color_eyre::{Result, eyre::Context};
use launch_pad::{ProcessKey, process::Process};
use color_eyre::Result;
use color_eyre::eyre::Context;
use launch_pad::ProcessKey;
use launch_pad::process::Process;
use rustix::fd::AsRawFd;
use std::{
os::{fd::OwnedFd, unix::net::UnixStream},
sync::Arc,
};
use std::os::fd::OwnedFd;
use std::os::unix::net::UnixStream;
use std::sync::Arc;
use tokio::sync::Mutex;
use tracing::Instrument;

View file

@ -1,15 +1,11 @@
// SPDX-License-Identifier: GPL-3.0-only
use std::{
path::Path,
process::{Command, Stdio},
sync::OnceLock,
};
use std::path::Path;
use std::process::{Command, Stdio};
use std::sync::OnceLock;
use zbus::{
Connection,
zvariant::{Array, OwnedValue},
};
use zbus::Connection;
use zbus::zvariant::{Array, OwnedValue};
#[derive(Debug)]
pub struct EnvVar {