Skip to content

Commit

Permalink
make module order deterministic and fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
sdankel committed Nov 12, 2024
1 parent 4a80c64 commit 31c6180
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions forc-plugins/forc-doc/src/search.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::doc::{module::ModuleInfo, Document, Documentation};
use anyhow::Result;
use serde::{Deserialize, Serialize};
use std::{collections::HashMap, fs, path::Path};
use std::{collections::{BTreeMap, HashMap}, fs, path::Path};

const JS_SEARCH_FILE_NAME: &str = "search.js";

Expand All @@ -19,7 +19,7 @@ impl Documentation {
/// and returns the map as a `serde_json::Value`.
fn to_search_index_json_value(&self) -> Result<serde_json::Value, serde_json::Error> {
let mut map = HashMap::with_capacity(self.len());
let mut modules = HashMap::new();
let mut modules = BTreeMap::new();
for doc in self.iter() {
let project_name = doc.module_info.project_name().to_string();
map.entry(project_name)
Expand Down
Loading

0 comments on commit 31c6180

Please sign in to comment.