Skip to content

Commit 92bb6fc

Browse files
committed
chore(release): 3.0.0-beta.5
1 parent d6d0420 commit 92bb6fc

10 files changed

Lines changed: 53 additions & 30 deletions

File tree

rust/Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ members = ["crates/spicetify", "crates/cli", "crates/tui", "crates/daemon"]
33
resolver = "2"
44

55
[workspace.package]
6-
version = "3.0.0-beta.4"
6+
version = "3.0.0-beta.5"
77
edition = "2024"
88
rust-version = "1.95"
99
repository = "https://github.com/veryboringhwl/app"

rust/crates/daemon/src/routes.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ fn offered_token(headers: &HeaderMap) -> Option<(String, String)> {
5252
.split(',')
5353
.map(str::trim)
5454
.find_map(|proto| {
55-
proto.strip_prefix(TOKEN_PROTOCOL_PREFIX).map(|tok| (proto.to_string(), tok.to_string()))
55+
proto
56+
.strip_prefix(TOKEN_PROTOCOL_PREFIX)
57+
.map(|tok| (proto.to_string(), tok.to_string()))
5658
})
5759
}
5860

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ pub(crate) fn run(ctx: &AppContext) -> Result<()> {
3333

3434
if !spa.exists() && !ctx.mirror && backup.exists() {
3535
tracing::info!("{}", fl!("restoring-spa-backup", path = spa.to_string_lossy()));
36-
std::fs::rename(&backup, &spa).map_err(fs_err("restoring xpui.spa from the backup at", &spa))?;
36+
std::fs::rename(&backup, &spa)
37+
.map_err(fs_err("restoring xpui.spa from the backup at", &spa))?;
3738
}
3839

3940
// Names the path on failure: a bare "Permission denied" here means the
@@ -109,9 +110,11 @@ pub(crate) fn run(ctx: &AppContext) -> Result<()> {
109110
}
110111

111112
if dest_xpui.exists() {
112-
std::fs::remove_dir_all(&dest_xpui).map_err(fs_err("removing the previous xpui at", &dest_xpui))?;
113+
std::fs::remove_dir_all(&dest_xpui)
114+
.map_err(fs_err("removing the previous xpui at", &dest_xpui))?;
113115
}
114-
std::fs::rename(&tmp, &dest_xpui).map_err(fs_err("installing the patched client to", &dest_xpui))?;
116+
std::fs::rename(&tmp, &dest_xpui)
117+
.map_err(fs_err("installing the patched client to", &dest_xpui))?;
115118

116119
ensure_daemon(ctx);
117120

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

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@ pub(crate) fn ensure_system_modules(ctx: &AppContext) {
137137
fn seed_system_module(ctx: &AppContext, vault: &Vault, id: &str) -> Result<()> {
138138
let module = vault.modules.get(id).ok_or_else(|| anyhow::anyhow!("not in the registry"))?;
139139
let version = resolve_version(module)?;
140-
let entry = module.v.get(&version).ok_or_else(|| anyhow::anyhow!("{version} is not in the registry"))?;
140+
let entry = module
141+
.v
142+
.get(&version)
143+
.ok_or_else(|| anyhow::anyhow!("{version} is not in the registry"))?;
141144
if entry.artifacts.is_empty() {
142145
anyhow::bail!("{id}@{version} has no artifact");
143146
}
@@ -243,8 +246,7 @@ mod tests {
243246
#[test]
244247
#[ignore = "hits the live registry and downloads artifacts"]
245248
fn seed_live_installs_and_enables_system_modules() {
246-
let root =
247-
std::env::temp_dir().join(format!("spicetify-seed-live-{}", std::process::id()));
249+
let root = std::env::temp_dir().join(format!("spicetify-seed-live-{}", std::process::id()));
248250
let _ = std::fs::remove_dir_all(&root);
249251
std::fs::create_dir_all(&root).expect("temp config");
250252

@@ -260,10 +262,7 @@ mod tests {
260262
for id in SYSTEM_MODULES {
261263
let link = modules_root.join(id);
262264
assert!(link.exists(), "{id} enabled and reachable through modules/");
263-
assert!(
264-
link.join("metadata.json").is_file(),
265-
"{id} unpacked with its metadata"
266-
);
265+
assert!(link.join("metadata.json").is_file(), "{id} unpacked with its metadata");
267266
}
268267
assert!(missing_system_modules(&modules_root).is_empty(), "nothing left to seed");
269268

@@ -276,10 +275,18 @@ mod tests {
276275
let _ = std::fs::remove_dir_all(&dir);
277276
std::fs::create_dir_all(&dir).expect("temp dir");
278277

279-
assert_eq!(missing_system_modules(&dir), vec!["stdlib", "store"], "a fresh config needs both");
278+
assert_eq!(
279+
missing_system_modules(&dir),
280+
vec!["stdlib", "store"],
281+
"a fresh config needs both"
282+
);
280283

281284
std::fs::create_dir_all(dir.join("stdlib")).expect("stdlib dir");
282-
assert_eq!(missing_system_modules(&dir), vec!["store"], "an installed module is left alone");
285+
assert_eq!(
286+
missing_system_modules(&dir),
287+
vec!["store"],
288+
"an installed module is left alone"
289+
);
283290

284291
std::fs::create_dir_all(dir.join("store")).expect("store dir");
285292
assert!(missing_system_modules(&dir).is_empty(), "nothing to seed once both exist");

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ fn perform(ctx: &AppContext, action: ProtocolAction, uri: &Url) -> Result<()> {
8989
// Spicetify.Daemon, a spicetify:// link) could otherwise supply
9090
// the hash of its own bytes and have them verified against
9191
// themselves, which is no verification at all.
92-
let checksum = crate::commands::pkg::registry_checksum(&id.module_identifier, &id.version)
93-
.unwrap_or_default();
92+
let checksum =
93+
crate::commands::pkg::registry_checksum(&id.module_identifier, &id.version)
94+
.unwrap_or_default();
9495
if checksum.is_empty() {
9596
tracing::warn!(
9697
"{id}: not in the registry, so there is no checksum to verify these bytes against"
@@ -176,7 +177,6 @@ fn require_param(query: &[(Cow<'_, str>, Cow<'_, str>)], key: &str) -> Result<St
176177
.ok_or_else(|| anyhow::anyhow!("missing '{key}' query parameter"))
177178
}
178179

179-
180180
fn get_all_params(query: &[(Cow<'_, str>, Cow<'_, str>)], key: &str) -> Vec<String> {
181181
query.iter().filter(|(k, _)| k == key).map(|(_, v)| v.to_string()).collect()
182182
}

rust/crates/spicetify/src/context.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,12 @@ mod tests {
225225
#[test]
226226
fn fixup_drops_a_stale_data_dir_so_detection_can_run() {
227227
let mut cfg = Config {
228-
spotify_data_dir: Some(PathBuf::from("/spicetify-nonexistent/Spotify.app/Contents/Resources")),
229-
spotify_exec: Some(PathBuf::from("/spicetify-nonexistent/Spotify.app/Contents/MacOS/Spotify")),
228+
spotify_data_dir: Some(PathBuf::from(
229+
"/spicetify-nonexistent/Spotify.app/Contents/Resources",
230+
)),
231+
spotify_exec: Some(PathBuf::from(
232+
"/spicetify-nonexistent/Spotify.app/Contents/MacOS/Spotify",
233+
)),
230234
..Config::default()
231235
};
232236
// Neither path exists: the stale-config shape that shadowed detection

rust/crates/spicetify/src/module/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ fn verify_checksum(expected: &str, bytes: &[u8]) -> Result<()> {
8585
let want = want.trim_start_matches("sha256:");
8686
let got = remote::digest(bytes);
8787
if want != got {
88-
anyhow::bail!("checksum mismatch: the vault declares sha256:{want}, the download is sha256:{got}");
88+
anyhow::bail!(
89+
"checksum mismatch: the vault declares sha256:{want}, the download is sha256:{got}"
90+
);
8991
}
9092
Ok(())
9193
}

rust/crates/spicetify/src/platform/macos.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ pub(crate) const fn spotify_binary_name() -> &'static str {
2323
/// location, fall back to the per-user one, then to Launch Services, and
2424
/// finally name `/Applications` so an error still points somewhere real.
2525
fn spotify_app_bundle() -> PathBuf {
26-
let candidates =
27-
[PathBuf::from("/Applications/Spotify.app"), base_dirs().home_dir().join("Applications/Spotify.app")];
26+
let candidates = [
27+
PathBuf::from("/Applications/Spotify.app"),
28+
base_dirs().home_dir().join("Applications/Spotify.app"),
29+
];
2830
resolve_bundle(&candidates, spotlight_spotify)
2931
}
3032

@@ -192,7 +194,8 @@ mod tests {
192194
// would be skipped like an empty leftover Spotify.app.
193195
let present = dir.clone();
194196
std::fs::create_dir_all(present.join("Contents").join("MacOS")).expect("bundle dirs");
195-
std::fs::write(present.join("Contents").join("MacOS").join("Spotify"), b"").expect("bundle exec");
197+
std::fs::write(present.join("Contents").join("MacOS").join("Spotify"), b"")
198+
.expect("bundle exec");
196199
// A sentinel from spotlight proves it was never consulted: the valid
197200
// candidate short-circuits before the fallback runs.
198201
let sentinel = PathBuf::from("/sentinel/Spotify.app");
@@ -205,7 +208,10 @@ mod tests {
205208
fn resolve_bundle_falls_back_to_spotlight_then_applications() {
206209
let missing = PathBuf::from("/definitely/not/here/Spotify.app");
207210
let spotlit = PathBuf::from("/Users/someone/Applications/Spotify.app");
208-
assert_eq!(resolve_bundle(std::slice::from_ref(&missing), || Some(spotlit.clone())), spotlit);
211+
assert_eq!(
212+
resolve_bundle(std::slice::from_ref(&missing), || Some(spotlit.clone())),
213+
spotlit
214+
);
209215
assert_eq!(
210216
resolve_bundle(&[missing], || None),
211217
PathBuf::from("/Applications/Spotify.app"),

rust/crates/spicetify/src/util/link.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ mod removal_tests {
144144
use super::*;
145145

146146
fn scratch(name: &str) -> std::path::PathBuf {
147-
let dir =
148-
std::env::temp_dir().join(format!("spicetify-rm-{name}-{}", std::process::id()));
147+
let dir = std::env::temp_dir().join(format!("spicetify-rm-{name}-{}", std::process::id()));
149148
let _ = std::fs::remove_dir_all(&dir);
150149
std::fs::create_dir_all(&dir).expect("temp dir");
151150
dir

0 commit comments

Comments
 (0)