swift-bridge
swift-bridge copied to clipboard
Clippy finds clippy::unnecessary-cast
Clippy complains:
error: casting raw pointers to the same type and constness is unnecessary (`*mut my_mod::FfiThing` -> `*mut my_mod::FfiThing`)
For this declaration:
#[swift_bridge::bridge]
mod ffi {
// ...
extern "Rust" {
type FfiThing;
#[swift_bridge(swift_name = "a")]
fn a(&self) -> Option<FfiX>;
#[swift_bridge(swift_name = "b")]
fn b(&self) -> Option<FfiY>;
}
// ...
}
pub struct FfiThing {
a: Option<FfiTypeA>,
b: Option<FfiTypeB>,
}
impl FfiViewport {
fn a(&self) -> Option<FfiTypeA> {
self.a.clone()
}
fn b(&self) -> Option<FfiTypeB> {
self.b.clone()
}
}