Skip to content

Commit

Permalink
use btreemap for determenstic tab placement
Browse files Browse the repository at this point in the history
  • Loading branch information
Commander07 committed Jun 25, 2024
1 parent 3833796 commit db930a9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/gui.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{collections::HashMap, path::PathBuf};
use std::{collections::BTreeMap, path::PathBuf};

use base64::{engine, Engine};
use dioxus::prelude::*;
Expand Down Expand Up @@ -513,7 +513,7 @@ struct VersionProps {
error: Signal<Option<String>>,
name: Signal<String>,
page: Signal<usize>,
pages: Signal<HashMap<usize, String>>,
pages: Signal<BTreeMap<usize, String>>,
}

#[component]
Expand Down Expand Up @@ -796,7 +796,7 @@ fn Version(mut props: VersionProps) -> Element {
}

#[component]
fn Pagination(mut page: Signal<usize>, mut pages: Signal<HashMap<usize, String>>) -> Element {
fn Pagination(mut page: Signal<usize>, mut pages: Signal<BTreeMap<usize, String>>) -> Element {
rsx!(
div {
class: "pagination",
Expand Down Expand Up @@ -850,7 +850,7 @@ pub(crate) fn app() -> Element {
});
}
let page = use_signal(|| 0);
let pages = use_signal(|| HashMap::new());
let pages = use_signal(|| BTreeMap::new());
let cfg = config.with(|cfg| cfg.clone());
let launcher = match super::get_launcher(&cfg.launcher) {
Ok(val) => Some(val),
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,15 +519,15 @@ impl Display for DownloadError {

DownloadError::FailedToParseResponse(item, e) => write!(
f,
"Failed to parse download response: '{e}' when attempting to download: '{item}'"
"Failed to parse download response: '{e:#?}' when attempting to download: '{item}'"
),
DownloadError::IoError(item, e) => write!(
f,
"Encountered io error: '{e}' when attempting to download: '{item}'"
"Encountered io error: '{e:#?}' when attempting to download: '{item}'"
),
DownloadError::HttpError(item, e) => write!(
f,
"Encountered http error: '{e}' when attempting to download: '{item}'"
"Encountered http error: '{e:#?}' when attempting to download: '{item}'"
),
DownloadError::MissingFilename(item) => {
write!(f, "Could not get filename for: '{item}'")
Expand Down

0 comments on commit db930a9

Please sign in to comment.