Skip to content

Commit

Permalink
rust: convert netinfo_driver to Option
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravenslofty authored and gatecat committed Jan 18, 2024
1 parent 14a0906 commit a0e360f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rust/nextpnr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a0e360f

Please sign in to comment.