swift-bridge
swift-bridge copied to clipboard
Support failable initializers
trafficstars
Related to #235.
This PR supports failable initializers.
Something like:
// Rust side
#[swift_bridge::bridge]
mod ffi {
extern "Rust" {
#[swift_bridge(Equatable)]
type FailableInitType;
#[swift_bridge(init)]
fn new() -> Option<FailableInitType>;
}
}
// Swift side
let failableInitType = FailableInitType()
if failableInitType == nil {
~
} else {
~
}
My feedback was minor, so feel free to Squash and merge after you address it.
When you Squash and merge remember to paste in your PR body as the commit message.
Alternatively you can rebase into a single commit, force push that, and then merge that. But Squash and merge essentially does the same thing.
Hello, hello. Still planning to land this?
Sorry. I'll address your review this weekend if possible.