Skip to content

Commit c4a7df4

Browse files
committed
style(rust): apply rustfmt across the workspace
1 parent 0e9c563 commit c4a7df4

6 files changed

Lines changed: 19 additions & 17 deletions

File tree

rust/crates/cli/src/main.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ use std::io::{self, Write};
33
use anyhow::Result;
44
use clap::{Parser, Subcommand};
55
use i18n_embed_fl as _;
6-
use spicetify::commands::{Command, ConfigAction, DaemonAction, PkgAction, SyncTarget, UpdatesAction};
6+
use spicetify::commands::{
7+
Command, ConfigAction, DaemonAction, PkgAction, SyncTarget, UpdatesAction,
8+
};
79
use spicetify::{fl, logging};
810

911
#[derive(Debug, Parser)]
@@ -73,7 +75,11 @@ enum CliCommand {
7375
Sync {
7476
#[arg(long)]
7577
url: Option<String>,
76-
#[arg(long, conflicts_with = "url", help = "Stage a locally built payload directory (development)")]
78+
#[arg(
79+
long,
80+
conflicts_with = "url",
81+
help = "Stage a locally built payload directory (development)"
82+
)]
7783
local: Option<String>,
7884
},
7985
}

rust/crates/spicetify/src/commands/diagnostics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ pub(crate) fn support(ctx: &AppContext) -> Result<()> {
3434
let staged = std::fs::read_dir(ctx.dest_apps_path().join("xpui").join("modules"))
3535
.map(|d| d.filter_map(std::result::Result::ok).filter(|e| e.path().is_dir()).count())
3636
.unwrap_or_default();
37-
let blocked = super::updates::is_blocked(ctx)
38-
.map_or_else(|_| "unknown".to_string(), |b| b.to_string());
37+
let blocked =
38+
super::updates::is_blocked(ctx).map_or_else(|_| "unknown".to_string(), |b| b.to_string());
3939

4040
tracing::info!("cli: {} (rust)", env!("CARGO_PKG_VERSION"));
4141
tracing::info!("spotify: {version}");

rust/crates/spicetify/src/commands/pkg.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,7 @@ fn resolve_version(module: &VaultModule) -> Result<String> {
8686
}
8787
anyhow::bail!("enabled version {} is not in the vault", module.enabled);
8888
}
89-
module
90-
.v
91-
.keys()
92-
.next_back()
93-
.cloned()
94-
.ok_or_else(|| anyhow::anyhow!("no versions in the vault"))
89+
module.v.keys().next_back().cloned().ok_or_else(|| anyhow::anyhow!("no versions in the vault"))
9590
}
9691

9792
/// Installed modules, read from disk rather than the vault.
@@ -136,9 +131,7 @@ pub(crate) fn install(ctx: &AppContext, identifier: &str) -> Result<()> {
136131
}
137132
};
138133
let Some(module) = vault.modules.get(identifier) else {
139-
near.extend(
140-
vault.modules.keys().filter(|k| k.contains(identifier)).take(3).cloned(),
141-
);
134+
near.extend(vault.modules.keys().filter(|k| k.contains(identifier)).take(3).cloned());
142135
continue;
143136
};
144137
let version = resolve_version(module)?;
@@ -155,7 +148,10 @@ pub(crate) fn install(ctx: &AppContext, identifier: &str) -> Result<()> {
155148
if near.is_empty() {
156149
anyhow::bail!("module not found in any vault: {identifier}");
157150
}
158-
anyhow::bail!("module not found in any vault: {identifier} (did you mean: {}?)", near.join(", "))
151+
anyhow::bail!(
152+
"module not found in any vault: {identifier} (did you mean: {}?)",
153+
near.join(", ")
154+
)
159155
}
160156

161157
/// Adds a community vault by name or URL. Only HTTPS origins are accepted:

rust/crates/spicetify/src/daemon/process.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub fn spawn() -> Result<(), DaemonSpawnError> {
3535
use std::os::windows::process::CommandExt;
3636

3737
use windows::Win32::System::Threading::{
38-
CREATE_NEW_PROCESS_GROUP, CREATE_NO_WINDOW, DETACHED_PROCESS
38+
CREATE_NEW_PROCESS_GROUP, CREATE_NO_WINDOW, DETACHED_PROCESS,
3939
};
4040
cmd =
4141
cmd.creation_flags((CREATE_NO_WINDOW | CREATE_NEW_PROCESS_GROUP | DETACHED_PROCESS).0);

rust/crates/spicetify/src/process.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ fn spawn_binary(ctx: &AppContext) -> Result<()> {
153153
use std::os::windows::process::CommandExt;
154154

155155
use windows::Win32::System::Threading::{
156-
CREATE_NEW_PROCESS_GROUP, CREATE_NO_WINDOW, DETACHED_PROCESS
156+
CREATE_NEW_PROCESS_GROUP, CREATE_NO_WINDOW, DETACHED_PROCESS,
157157
};
158158

159159
let exe = &ctx.spotify_exec;

rust/crates/tui/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub use app::{LayoutState, Page, RunStatus, TuiApp};
1212
use crossterm::event::{DisableMouseCapture, EnableMouseCapture};
1313
use crossterm::execute;
1414
use crossterm::terminal::{
15-
EnterAlternateScreen, LeaveAlternateScreen, disable_raw_mode, enable_raw_mode
15+
EnterAlternateScreen, LeaveAlternateScreen, disable_raw_mode, enable_raw_mode,
1616
};
1717
use i18n_embed_fl as _;
1818
use ratatui::Terminal;

0 commit comments

Comments
 (0)