Skip to content

Commit

Permalink
use BTreeMap for sorting extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
sehnryr committed Oct 20, 2024
1 parent e845d16 commit 75ef59b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ tauri-build = { version = "2.0.1", features = [] }
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
log = "0.4"
# midoku-bindings = { git = "https://github.com/midokuapp/midoku-rs.git", rev = "38e43453fda106eac36895893e9133fc7444aa90" }
midoku-bindings = { path = "../../midoku-rs/midoku-bindings" }
midoku-bindings = { git = "https://github.com/midokuapp/midoku-rs.git", rev = "0696331e6a851ce34b0ca31282992ac83667f36f" }
tauri = { version = "2.0.3", features = ["protocol-asset"] }
tauri-plugin-log = "2.0.0-rc"
tokio = { version = "1.40.0", features = ["full"] }
6 changes: 3 additions & 3 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::collections::HashMap;
use std::collections::BTreeMap;
use std::path::PathBuf;
use std::sync::{Mutex, MutexGuard};

Expand Down Expand Up @@ -106,7 +106,7 @@ impl Extension {
}

struct Extensions {
store: Mutex<HashMap<String, Extension>>,
store: Mutex<BTreeMap<String, Extension>>,
}

impl Extensions {
Expand Down Expand Up @@ -135,7 +135,7 @@ impl Extensions {
}
}

fn lock(&self) -> MutexGuard<'_, HashMap<String, Extension>> {
fn lock(&self) -> MutexGuard<'_, BTreeMap<String, Extension>> {
self.store.lock().expect("failed to lock extensions store")
}
}
Expand Down

0 comments on commit 75ef59b

Please sign in to comment.