Skip to content

Commit

Permalink
Rollup merge of rust-lang#24494 - mvdnes:deterministic-sidebar, r=ale…
Browse files Browse the repository at this point in the history
…xcrichton

This ensures that later when generating HTML, the JSON will be sorted aswell.
We now have a more deterministic build of sidebar-items.js

Closes rust-lang#24473
  • Loading branch information
steveklabnik committed Apr 16, 2015
2 parents 63c12c1 + 61ad9fe commit 77adfb9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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 }

Expand Down

0 comments on commit 77adfb9

Please sign in to comment.