debug-map-sorted

Crates.iodebug-map-sorted
lib.rsdebug-map-sorted
version0.1.1
sourcesrc
created_at2022-11-08 23:59:42.697801+00
updated_at2022-11-09 00:24:14.294856+00
descriptionSorted Debug impl for HashMap
homepage
repositoryhttps://github.com/JarredAllen/debug-map-sorted
max_upload_size
id708392
size4,508
Jarred Allen (JarredAllen)

documentation

https://docs.rs/crate/debug-map-sorted/latest

README

debug-map-sorted

crates.io

An implementation of Debug on a wrapper for [HashMap] which displays the output in sorted order.

See [SortedHashMapDebugOutput] for more info.

Example usage

# use std::collections::HashMap;
use debug_map_sorted::SortedOutputExt;

let data: HashMap<usize, &'static str> = [(0, "zero"), (1, "one"), (2, "two")]
                                                .into_iter().collect();
assert_eq!(
    format!("{:?}", data.sorted_debug()),
    "{0: \"zero\", 1: \"one\", 2: \"two\"}"
);
Commit count: 2

cargo fmt