diff options
| author | Mathijs van de Nes <git@mathijs.vd-nes.nl> | 2015-04-16 12:14:45 +0200 |
|---|---|---|
| committer | Mathijs van de Nes <git@mathijs.vd-nes.nl> | 2015-04-16 12:14:45 +0200 |
| commit | 61ad9fe1a3a34d358c3922d77557f626e4a21232 (patch) | |
| tree | 5b5cd8a29ee94ae551c119cd99ddb898dd31a3d5 | |
| parent | 798fa2276c31f4661b1c3d96b627337f59e907b4 (diff) | |
| download | rust-61ad9fe1a3a34d358c3922d77557f626e4a21232.tar.gz rust-61ad9fe1a3a34d358c3922d77557f626e4a21232.zip | |
Use BTreeMap in build_sidebar_items
This ensures that later when generating HTML, the JSON will be sorted aswell. We now have a deterministic build of sidebar-items.js
| -rw-r--r-- | src/librustdoc/html/render.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 5f4a3e74b65..54fbdc28968 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -37,7 +37,7 @@ pub use self::ExternalLocation::*; use std::ascii::OwnedAsciiExt; use std::cell::RefCell; use std::cmp::Ordering; -use std::collections::{HashMap, HashSet}; +use std::collections::{BTreeMap, HashMap, HashSet}; use std::default::Default; use std::fmt; use std::fs::{self, File}; @@ -1319,8 +1319,9 @@ impl Context { } } - fn build_sidebar_items(&self, m: &clean::Module) -> HashMap<String, Vec<NameDoc>> { - let mut map = HashMap::new(); + fn build_sidebar_items(&self, m: &clean::Module) -> BTreeMap<String, Vec<NameDoc>> { + // BTreeMap instead of HashMap to get a sorted output + let mut map = BTreeMap::new(); for item in &m.items { if self.ignore_private_item(item) { continue } |
