From a0e360fd9f3c73f36d42e4b8450c339858a8de47 Mon Sep 17 00:00:00 2001 From: Lofty Date: Wed, 17 Jan 2024 12:25:00 +0000 Subject: [PATCH] rust: convert netinfo_driver to Option --- rust/nextpnr/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/nextpnr/src/lib.rs b/rust/nextpnr/src/lib.rs index b3386ebc..66a96ee1 100644 --- a/rust/nextpnr/src/lib.rs +++ b/rust/nextpnr/src/lib.rs @@ -32,7 +32,7 @@ pub struct NetInfo { } impl NetInfo { - pub fn driver(&mut self) -> &mut PortRef { + pub fn driver(&mut self) -> Option<&mut PortRef> { unsafe { npnr_netinfo_driver(self) } } @@ -412,7 +412,7 @@ extern "C" { fn npnr_context_get_pips_uphill(ctx: &Context, wire: WireId) -> &mut RawUphillIter; fn npnr_delete_uphill_iter(iter: &mut RawUphillIter); - fn npnr_netinfo_driver(net: &mut NetInfo) -> &mut PortRef; + fn npnr_netinfo_driver(net: &mut NetInfo) -> Option<&mut PortRef>; fn npnr_netinfo_users_leak(net: &NetInfo, users: *mut *mut *const PortRef) -> u32; fn npnr_netinfo_is_global(net: &NetInfo) -> bool; fn npnr_netinfo_udata(net: &NetInfo) -> NetIndex;