Skip to content

Commit a4cbb09

Browse files
committed
swift: Make initialization fns have a stable ordering (#2651)
1 parent 1db0c36 commit a4cbb09

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
Custom types too ([#2603](https://github.com/mozilla/uniffi-rs/pull/2603))
2727
- Kotlin: The `NoPointer` placeholder object used to create fake interface instances has been renamed to `NoHandle`
2828
- Python: methods now have typing annotations for return values ([#2625](https://github.com/mozilla/uniffi-rs/issues/2625))
29+
- Swift: initialization functions now have a stable ordering when using external types.
30+
This makes the generated source files more deterministic.
2931

3032
### ⚠️ Breaking Changes for external bindings authors ⚠️
3133

uniffi_bindgen/src/bindings/swift/gen_swift/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,8 @@ impl<'a> SwiftWrapper<'a> {
506506
module_path.to_upper_camel_case()
507507
)
508508
})
509-
// Collect into a hash set to de-dup
510-
.collect::<HashSet<_>>();
509+
// Collect into a btree set to de-dup and order
510+
.collect::<BTreeSet<_>>();
511511

512512
init_fns.chain(extern_module_init_fns).collect()
513513
}

0 commit comments

Comments
 (0)