Skip to content

Commit

Permalink
Ordering of the modules by their name ref rune-rs#648
Browse files Browse the repository at this point in the history
  • Loading branch information
Roba1993 committed Mar 13, 2024
1 parent 4ff86ea commit ccc8058
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/rune/src/doc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,18 @@ pub(crate) fn build(
tests: Vec::new(),
};

// sort the crates by their name
initial.make_contiguous().sort_by_key(|item| {
if let Build::Module(m) = item {
if let Some(item) = m.item {
if let Some(name) = item.as_crate() {
return name;
}
}
}
""
});

let mut queue = initial.into_iter().try_collect::<VecDeque<_>>()?;

let mut modules = Vec::new();
Expand Down

0 comments on commit ccc8058

Please sign in to comment.