Skip to content

Commit

Permalink
Merge pull request #1320 from phil-opp/use-correct-methods
Browse files Browse the repository at this point in the history
Fix: Use correct methods when writing toposorted structs
  • Loading branch information
dtolnay authored Feb 28, 2024
2 parents 7eef562 + eabcb31 commit c348175
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gen/src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ fn write_data_structures<'a>(out: &mut OutFile<'a>, apis: &'a [Api]) {
match api {
Api::Struct(strct) if !structs_written.contains(&strct.name.rust) => {
for next in &mut toposorted_structs {
if !out.types.cxx.contains(&strct.name.rust) {
if !out.types.cxx.contains(&next.name.rust) {
out.next_section();
let methods = methods_for_type
.get(&strct.name.rust)
.get(&next.name.rust)
.map(Vec::as_slice)
.unwrap_or_default();
write_struct(out, next, methods);
Expand Down

0 comments on commit c348175

Please sign in to comment.