From db930a92ac012a28ea48d030635a328da201f9c3 Mon Sep 17 00:00:00 2001 From: Commander07 <45269106+Commander07@users.noreply.github.com> Date: Tue, 25 Jun 2024 13:52:20 +0200 Subject: [PATCH] use btreemap for determenstic tab placement --- src/gui.rs | 8 ++++---- src/main.rs | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui.rs b/src/gui.rs index 8ac0f58..1497ccc 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -1,4 +1,4 @@ -use std::{collections::HashMap, path::PathBuf}; +use std::{collections::BTreeMap, path::PathBuf}; use base64::{engine, Engine}; use dioxus::prelude::*; @@ -513,7 +513,7 @@ struct VersionProps { error: Signal>, name: Signal, page: Signal, - pages: Signal>, + pages: Signal>, } #[component] @@ -796,7 +796,7 @@ fn Version(mut props: VersionProps) -> Element { } #[component] -fn Pagination(mut page: Signal, mut pages: Signal>) -> Element { +fn Pagination(mut page: Signal, mut pages: Signal>) -> Element { rsx!( div { class: "pagination", @@ -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), diff --git a/src/main.rs b/src/main.rs index 194ea77..7f52bd8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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}'")