diff --git a/Cargo.toml b/Cargo.toml index 2094f961..03505198 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,6 +34,7 @@ anyhow = "1.0.97" async-channel = "2.5.0" ggemini = "0.19.0" ggemtext = "0.7.0" +indexmap = "2.10.0" itertools = "0.14.0" # libspelling = "0.4.0" maxminddb = "0.26.0" diff --git a/src/app/browser/bookmarks.rs b/src/app/browser/bookmarks.rs index 003c4514..454f0068 100644 --- a/src/app/browser/bookmarks.rs +++ b/src/app/browser/bookmarks.rs @@ -10,7 +10,8 @@ use adw::{ }, }; use gtk::glib::{DateTime, GString, Uri, UriFlags}; -use std::{collections::HashMap, rc::Rc}; +use indexmap::IndexMap; +use std::rc::Rc; struct Record { time: DateTime, @@ -24,7 +25,7 @@ pub trait Bookmarks { impl Bookmarks for adw::PreferencesDialog { fn bookmarks(window_action: &Rc, profile: &Rc) -> Self { - let mut index: HashMap> = HashMap::new(); + let mut index: IndexMap> = IndexMap::new(); for bookmark in profile.bookmark.recent(None) { match Uri::parse(&bookmark.request, UriFlags::NONE) { Ok(uri) => index diff --git a/src/app/browser/history.rs b/src/app/browser/history.rs index 9c7c64ea..b0d522e6 100644 --- a/src/app/browser/history.rs +++ b/src/app/browser/history.rs @@ -10,7 +10,8 @@ use adw::{ }, }; use gtk::glib::{DateTime, GString, Uri, UriFlags, gformat}; -use std::{collections::HashMap, rc::Rc}; +use indexmap::IndexMap; +use std::rc::Rc; pub struct Event { pub time: DateTime, @@ -29,7 +30,7 @@ pub trait History { impl History for adw::PreferencesDialog { fn history(window_action: &Rc, profile: &Rc) -> Self { - let mut visited: HashMap> = HashMap::new(); + let mut visited: IndexMap> = IndexMap::new(); // @TODO recently closed for history in profile.history.recently_opened(None) {