Apply rustfmt pass across all modules
Pure whitespace normalization — no logic changes. Mostly: - collapsing multi-line match/if arms rustfmt prefers inline - inlining short `with_context`/`ok_or_else` closures - reformatting nested method chains for consistency Build and clippy stay clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+24
-27
@@ -188,10 +188,7 @@ enum ConfigAction {
|
||||
gamescope: Option<String>,
|
||||
},
|
||||
/// Remove a game from a launcher
|
||||
RemoveGame {
|
||||
launcher: String,
|
||||
name: String,
|
||||
},
|
||||
RemoveGame { launcher: String, name: String },
|
||||
/// Toggle per-game overlay flags
|
||||
SetGameFlags {
|
||||
launcher: String,
|
||||
@@ -267,7 +264,10 @@ fn main() -> Result<()> {
|
||||
}
|
||||
}
|
||||
|
||||
Commands::Play { launcher: lname, game: gname } => {
|
||||
Commands::Play {
|
||||
launcher: lname,
|
||||
game: gname,
|
||||
} => {
|
||||
let l = config.find(&lname).ok_or_else(|| {
|
||||
anyhow::anyhow!("unknown launcher '{lname}' — try `umutray launchers`")
|
||||
})?;
|
||||
@@ -294,7 +294,11 @@ fn main() -> Result<()> {
|
||||
println!(" {}:", l.display);
|
||||
for g in &l.games {
|
||||
let installed = g.full_exe_path(l).exists();
|
||||
let marker = if installed { "\x1b[1;32m✓\x1b[0m" } else { "·" };
|
||||
let marker = if installed {
|
||||
"\x1b[1;32m✓\x1b[0m"
|
||||
} else {
|
||||
"·"
|
||||
};
|
||||
let flags = format_game_flags(g);
|
||||
println!(" {marker} {:14} {}{}", g.name, g.display, flags);
|
||||
}
|
||||
@@ -312,7 +316,11 @@ fn main() -> Result<()> {
|
||||
detect::run(&config, &dir, apply)?;
|
||||
}
|
||||
|
||||
Commands::UpdateProton { latest, version, list } => {
|
||||
Commands::UpdateProton {
|
||||
latest,
|
||||
version,
|
||||
list,
|
||||
} => {
|
||||
proton::run(&config, latest, version, list)?;
|
||||
}
|
||||
|
||||
@@ -322,7 +330,10 @@ fn main() -> Result<()> {
|
||||
println!("{}", config::Config::config_path()?.display());
|
||||
}
|
||||
ConfigAction::Edit => config::Config::edit()?,
|
||||
ConfigAction::Set { proton_version, compat_dir } => {
|
||||
ConfigAction::Set {
|
||||
proton_version,
|
||||
compat_dir,
|
||||
} => {
|
||||
let mut c = config;
|
||||
c.set_globals(proton_version, compat_dir)?;
|
||||
}
|
||||
@@ -360,18 +371,9 @@ fn main() -> Result<()> {
|
||||
gamescope,
|
||||
} => {
|
||||
let mut c = config;
|
||||
let gs = gamescope.map(|s| {
|
||||
s.split_whitespace().map(String::from).collect::<Vec<_>>()
|
||||
});
|
||||
c.add_game(
|
||||
&launcher,
|
||||
name,
|
||||
display,
|
||||
exe_path,
|
||||
gamemode,
|
||||
mangohud,
|
||||
gs,
|
||||
)?;
|
||||
let gs =
|
||||
gamescope.map(|s| s.split_whitespace().map(String::from).collect::<Vec<_>>());
|
||||
c.add_game(&launcher, name, display, exe_path, gamemode, mangohud, gs)?;
|
||||
}
|
||||
ConfigAction::RemoveGame { launcher, name } => {
|
||||
let mut c = config;
|
||||
@@ -388,13 +390,8 @@ fn main() -> Result<()> {
|
||||
let gs_update = if no_gamescope {
|
||||
Some(None)
|
||||
} else {
|
||||
gamescope.map(|s| {
|
||||
Some(
|
||||
s.split_whitespace()
|
||||
.map(String::from)
|
||||
.collect::<Vec<_>>(),
|
||||
)
|
||||
})
|
||||
gamescope
|
||||
.map(|s| Some(s.split_whitespace().map(String::from).collect::<Vec<_>>()))
|
||||
};
|
||||
let mut c = config;
|
||||
c.set_game_flags(&launcher, &name, gamemode, mangohud, gs_update)?;
|
||||
|
||||
Reference in New Issue
Block a user