Skip to content

Commit

Permalink
sort by app name
Browse files Browse the repository at this point in the history
  • Loading branch information
rfvgyhn committed Nov 3, 2023
1 parent b039e9b commit 8b13742
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub fn parse_launch_options(steam_home: &Path) -> Result<LaunchOptionsConfig> {

let mut result = BTreeMap::new();
for (id, options) in launch_options {
let o = options
let mut o: Vec<LaunchOptions> = options
.iter()
.map(|l| {
let app = to_app(&l.app_id, &app_names, &registry, &shortcuts);
Expand All @@ -125,6 +125,7 @@ pub fn parse_launch_options(steam_home: &Path) -> Result<LaunchOptionsConfig> {
}
})
.collect();
o.sort_by(|a, b| a.app.name.cmp(&b.app.name));
let username = steam::get_display_name(&steam_home, &id)?;

Check failure on line 129 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Clippy

this expression creates a reference which is immediately dereferenced by the compiler
result.insert(username, o);
}
Expand All @@ -145,10 +146,11 @@ pub fn parse_tool_mapping(steam_home: &Path) -> Result<CompatToolConfig> {
let config = tool_mapping
.into_iter()
.map(|(tool, ids)| {
let names = ids
let mut names: Vec<App> = ids
.iter()
.map(|id| to_app(id, &app_names, &registry, &shortcuts))
.collect();
names.sort_by(|a, b| a.name.cmp(&b.name));
(tool, names)
})
.collect();
Expand Down

0 comments on commit 8b13742

Please sign in to comment.