chore(rustfmt): change imports_granularity to "Module"
Also includes a Zed config.
This commit is contained in:
parent
673e4c949b
commit
17cf4485a9
6 changed files with 55 additions and 39 deletions
15
.zed/settings.json
Normal file
15
.zed/settings.json
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"format_on_save": "on",
|
||||||
|
"lsp": {
|
||||||
|
"rust-analyzer": {
|
||||||
|
"initialization_options": {
|
||||||
|
"check": {
|
||||||
|
"command": "clippy",
|
||||||
|
},
|
||||||
|
"rustfmt": {
|
||||||
|
"extraArgs": ["+nightly"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -4,7 +4,7 @@ use_field_init_shorthand = true
|
||||||
# Unstable formatting options below; remove if you REALLY don't wanna use `cargo +nightly fmt`
|
# Unstable formatting options below; remove if you REALLY don't wanna use `cargo +nightly fmt`
|
||||||
format_code_in_doc_comments = true
|
format_code_in_doc_comments = true
|
||||||
format_strings = true
|
format_strings = true
|
||||||
imports_granularity = "Crate"
|
imports_granularity = "Module"
|
||||||
normalize_comments = true
|
normalize_comments = true
|
||||||
reorder_impl_items = true
|
reorder_impl_items = true
|
||||||
wrap_comments = true
|
wrap_comments = true
|
||||||
20
src/comp.rs
20
src/comp.rs
|
|
@ -1,17 +1,19 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
use color_eyre::eyre::{Result, WrapErr};
|
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 serde::{Deserialize, Serialize};
|
||||||
use std::{collections::HashMap, os::unix::prelude::*};
|
use std::collections::HashMap;
|
||||||
use tokio::{
|
use std::os::unix::prelude::*;
|
||||||
io::AsyncReadExt,
|
use tokio::io::AsyncReadExt;
|
||||||
net::{UnixStream, unix::OwnedReadHalf},
|
use tokio::net::UnixStream;
|
||||||
sync::{mpsc, oneshot},
|
use tokio::net::unix::OwnedReadHalf;
|
||||||
task::JoinHandle,
|
use tokio::sync::{mpsc, oneshot};
|
||||||
};
|
use tokio::task::JoinHandle;
|
||||||
use tokio_util::sync::CancellationToken;
|
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)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "snake_case", tag = "message")]
|
#[serde(rename_all = "snake_case", tag = "message")]
|
||||||
|
|
|
||||||
30
src/main.rs
30
src/main.rs
|
|
@ -9,30 +9,32 @@ mod process;
|
||||||
mod service;
|
mod service;
|
||||||
mod systemd;
|
mod systemd;
|
||||||
|
|
||||||
use color_eyre::{Result, eyre::WrapErr};
|
use color_eyre::Result;
|
||||||
use launch_pad::{ProcessManager, process::Process};
|
use color_eyre::eyre::WrapErr;
|
||||||
|
use launch_pad::ProcessManager;
|
||||||
|
use launch_pad::process::Process;
|
||||||
use service::SessionRequest;
|
use service::SessionRequest;
|
||||||
|
use std::borrow::Cow;
|
||||||
#[cfg(feature = "autostart")]
|
#[cfg(feature = "autostart")]
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
use std::env;
|
||||||
|
use std::os::fd::AsRawFd;
|
||||||
#[cfg(feature = "autostart")]
|
#[cfg(feature = "autostart")]
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
#[cfg(feature = "autostart")]
|
#[cfg(feature = "autostart")]
|
||||||
use std::process::{Command, Stdio};
|
use std::process::{Command, Stdio};
|
||||||
use std::{borrow::Cow, env, os::fd::AsRawFd, sync::Arc};
|
use std::sync::Arc;
|
||||||
#[cfg(feature = "systemd")]
|
#[cfg(feature = "systemd")]
|
||||||
use systemd::{get_systemd_env, is_systemd_used, spawn_scope};
|
use systemd::{get_systemd_env, is_systemd_used, spawn_scope};
|
||||||
use tokio::{
|
use tokio::signal::unix::{SignalKind, signal};
|
||||||
signal::unix::{SignalKind, signal},
|
use tokio::sync::mpsc::{Receiver, Sender};
|
||||||
sync::{
|
use tokio::sync::{Mutex, oneshot};
|
||||||
Mutex,
|
use tokio::time::Duration;
|
||||||
mpsc::{Receiver, Sender},
|
|
||||||
oneshot,
|
|
||||||
},
|
|
||||||
time::Duration,
|
|
||||||
};
|
|
||||||
use tokio_util::sync::CancellationToken;
|
use tokio_util::sync::CancellationToken;
|
||||||
use tracing::{Instrument, metadata::LevelFilter};
|
use tracing::Instrument;
|
||||||
use tracing_subscriber::{EnvFilter, fmt, prelude::*};
|
use tracing::metadata::LevelFilter;
|
||||||
|
use tracing_subscriber::prelude::*;
|
||||||
|
use tracing_subscriber::{EnvFilter, fmt};
|
||||||
|
|
||||||
use crate::notifications::{
|
use crate::notifications::{
|
||||||
DAEMON_NOTIFICATIONS_FD, PANEL_NOTIFICATIONS_FD, notifications_process,
|
DAEMON_NOTIFICATIONS_FD, PANEL_NOTIFICATIONS_FD, notifications_process,
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
use color_eyre::{Result, eyre::Context};
|
use color_eyre::Result;
|
||||||
use launch_pad::{ProcessKey, process::Process};
|
use color_eyre::eyre::Context;
|
||||||
|
use launch_pad::ProcessKey;
|
||||||
|
use launch_pad::process::Process;
|
||||||
use rustix::fd::AsRawFd;
|
use rustix::fd::AsRawFd;
|
||||||
use std::{
|
use std::os::fd::OwnedFd;
|
||||||
os::{fd::OwnedFd, unix::net::UnixStream},
|
use std::os::unix::net::UnixStream;
|
||||||
sync::Arc,
|
use std::sync::Arc;
|
||||||
};
|
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
use tracing::Instrument;
|
use tracing::Instrument;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,11 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
|
||||||
use std::{
|
use std::path::Path;
|
||||||
path::Path,
|
use std::process::{Command, Stdio};
|
||||||
process::{Command, Stdio},
|
use std::sync::OnceLock;
|
||||||
sync::OnceLock,
|
|
||||||
};
|
|
||||||
|
|
||||||
use zbus::{
|
use zbus::Connection;
|
||||||
Connection,
|
use zbus::zvariant::{Array, OwnedValue};
|
||||||
zvariant::{Array, OwnedValue},
|
|
||||||
};
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct EnvVar {
|
pub struct EnvVar {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue