Return BTreeMap instead of HashMap from get_info()

BTreeMap is sorted by keys when iterated, making it easier to find the
required line.
This commit is contained in:
Alexander Krotov
2020-04-28 21:25:59 +03:00
parent 2f5b6a115d
commit 46253039df
2 changed files with 6 additions and 6 deletions

View File

@@ -13,7 +13,7 @@ extern crate human_panic;
extern crate num_traits;
extern crate serde_json;
use std::collections::HashMap;
use std::collections::BTreeMap;
use std::convert::TryInto;
use std::ffi::CString;
use std::fmt::Write;
@@ -434,7 +434,7 @@ pub unsafe extern "C" fn dc_get_info(context: *mut dc_context_t) -> *mut libc::c
}
fn render_info(
info: HashMap<&'static str, String>,
info: BTreeMap<&'static str, String>,
) -> std::result::Result<String, std::fmt::Error> {
let mut res = String::new();
for (key, value) in &info {