signatures: Replace remaining uses of HashMap with BTreeMap

This commit is contained in:
Jonas Platte 2020-09-30 12:46:08 +02:00
parent 98982be7fb
commit 9b52601808
No known key found for this signature in database
GPG Key ID: 7D261D771D915378

View File

@ -1,6 +1,6 @@
//! Digital signatures and collections of signatures. //! Digital signatures and collections of signatures.
use std::collections::HashMap; use std::collections::BTreeMap;
use base64::{encode_config, STANDARD_NO_PAD}; use base64::{encode_config, STANDARD_NO_PAD};
@ -98,12 +98,12 @@ impl Signature {
/// A map from entity names to sets of digital signatures created by that entity. /// A map from entity names to sets of digital signatures created by that entity.
/// ///
/// "Entity" is generally a homeserver, e.g. "example.com". /// "Entity" is generally a homeserver, e.g. "example.com".
pub type SignatureMap = HashMap<String, SignatureSet>; pub type SignatureMap = BTreeMap<String, SignatureSet>;
/// A set of digital signatures created by a single homeserver. /// A set of digital signatures created by a single homeserver.
/// ///
/// This is represented as a map from signing key ID to Base64-encoded signature. /// This is represented as a map from signing key ID to Base64-encoded signature.
pub type SignatureSet = HashMap<String, String>; pub type SignatureSet = BTreeMap<String, String>;
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {