diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-11 02:05:34 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-11 02:05:34 +0900 |
| commit | 4df5f8491320e5795718cf0222e80fa27e57c8ad (patch) | |
| tree | 707e19f34dbdef18490ec3245d34389e3d189a57 /crates/mozart-core/src/repository/installed.rs | |
| parent | 8871b923fa3df1935c263db155cb8bc3d59705cd (diff) | |
| download | php-mozart-4df5f8491320e5795718cf0222e80fa27e57c8ad.tar.gz php-mozart-4df5f8491320e5795718cf0222e80fa27e57c8ad.tar.zst php-mozart-4df5f8491320e5795718cf0222e80fa27e57c8ad.zip | |
refactor(package): rename traits and switch dep maps to IndexMap
Rename Package/CompletePackage to PackageInterface/CompletePackageInterface
to mirror Composer's interface names, and split each into its own module
under crates/mozart-core/src/package/.
Switch dependency-link and metadata maps from BTreeMap to indexmap::IndexMap
so serialized JSON preserves the original key ordering rather than sorting
alphabetically — matching PHP associative-array semantics. The
--sort-packages behaviour in `require` is preserved via sort_unstable_keys.
Diffstat (limited to 'crates/mozart-core/src/repository/installed.rs')
| -rw-r--r-- | crates/mozart-core/src/repository/installed.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/mozart-core/src/repository/installed.rs b/crates/mozart-core/src/repository/installed.rs index 422f79f..4bee0e5 100644 --- a/crates/mozart-core/src/repository/installed.rs +++ b/crates/mozart-core/src/repository/installed.rs @@ -1,7 +1,6 @@ use crate::installer::HasSuggests; use crate::package::to_json_pretty; use serde::{Deserialize, Serialize}; -use std::collections::BTreeMap; use std::fs; use std::path::Path; @@ -56,7 +55,7 @@ pub struct InstalledPackageEntry { pub support: Option<serde_json::Value>, #[serde(flatten)] - pub extra_fields: BTreeMap<String, serde_json::Value>, + pub extra_fields: indexmap::IndexMap<String, serde_json::Value>, } impl HasSuggests for InstalledPackageEntry { @@ -215,7 +214,7 @@ mod tests { aliases: vec![], homepage: None, support: None, - extra_fields: BTreeMap::new(), + extra_fields: indexmap::IndexMap::new(), } } |
