Skip to content

Commit c176323

Browse files
committed
tighten the codegen ordering again, for collection
1 parent ea2f99b commit c176323

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

crates/bevy_api_gen/src/bin/main.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -122,19 +122,20 @@ fn main() {
122122
}
123123
});
124124
let meta_loader = MetaLoader::new(vec![output.to_owned()], workspace_meta);
125-
let context = Collect {
126-
crates: crates
127-
.map(|c| {
128-
let name = c.to_str().unwrap().to_owned();
129-
log::info!("Collecting crate: {}", name);
130-
let meta = meta_loader
131-
.meta_for(&name)
132-
.expect("Could not find meta file for crate");
133-
Crate { name, meta }
134-
})
135-
.collect(),
136-
api_name,
137-
};
125+
let mut crates: Vec<_> = crates
126+
.map(|c| {
127+
let name = c.to_str().unwrap().to_owned();
128+
log::info!("Collecting crate: {}", name);
129+
let meta = meta_loader
130+
.meta_for(&name)
131+
.expect("Could not find meta file for crate");
132+
Crate { name, meta }
133+
})
134+
.collect();
135+
136+
crates.sort_by(|a, b| a.name.cmp(&b.name));
137+
138+
let context = Collect { crates, api_name };
138139
let mut context =
139140
Context::from_serialize(context).expect("Could not create template context");
140141

0 commit comments

Comments
 (0)