change records map to BTreeMap to get stable ordering by entry ID

session-crate
Ondřej Hruška 5 years ago
parent 11cf0d1ca7
commit 6e69409c1a
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 3
      src/store/mod.rs

@ -6,6 +6,7 @@ use std::collections::HashMap;
use std::fs::{File, OpenOptions}; use std::fs::{File, OpenOptions};
use std::io::{Read, Write}; use std::io::{Read, Write};
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::collections::BTreeMap;
pub mod form; pub mod form;
pub mod model; pub mod model;
@ -35,7 +36,7 @@ struct RepositoryConfig {
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct Cards { pub struct Cards {
#[serde(default)] #[serde(default)]
pub cards: IndexMap<usize, Value>, pub cards: BTreeMap<usize, Value>,
#[serde(default)] #[serde(default)]
pub counter: usize, pub counter: usize,
} }

Loading…
Cancel
Save