diff options
author | Rosyid Haryadi <rosyid_haryadi@protonmail.com> | 2025-03-18 11:31:19 +0700 |
---|---|---|
committer | Rosyid Haryadi <rosyid_haryadi@protonmail.com> | 2025-03-18 11:31:19 +0700 |
commit | 52b0d3db1289a74aa4817b211c3fcbf0bba84a99 (patch) | |
tree | 3eeccc3b497d0e49f39a37c91073fec39d8bd9e7 /src/object.rs | |
parent | 2766f230eff64b63cf4c88e8c26019762a92494d (diff) |
upd: replace HashMap to IndexMap to preserve header's order
Diffstat (limited to 'src/object.rs')
-rw-r--r-- | src/object.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/object.rs b/src/object.rs index aa5f434..90a06f4 100644 --- a/src/object.rs +++ b/src/object.rs @@ -1,14 +1,14 @@ -use std::collections::HashMap; -use std::fs; +use crate::utilities::deserialize_kv_with_message; use crate::{create_path_or_die, die}; +use derive_is_enum_variant::is_enum_variant; use flate2::read::{ZlibDecoder, ZlibEncoder}; +use flate2::Compression; +use indexmap::IndexMap; +use sha1::{Digest, Sha1}; +use std::fs; use std::fs::File; use std::io::{BufReader, Read, Write}; use std::path::PathBuf; -use derive_is_enum_variant::is_enum_variant; -use flate2::Compression; -use sha1::{Digest, Sha1}; -use crate::utilities::deserialize_kv_with_message; #[derive(is_enum_variant)] pub enum GitObjectType { @@ -120,14 +120,14 @@ impl GitObject { } pub struct GitCommit { - header: HashMap<String, String>, + header: IndexMap<String, String>, message: String, } impl GitCommit { pub fn new() -> Self { Self { - header: HashMap::new(), + header: IndexMap::new(), message: String::new(), } } |