Apart from needing to fixup the NonNull::new() change, this looks good to me.
Must have misread that the Option it was assigned to a let binding rather than returned, while trying to scan for similar patterns that could use let-else. Changed it to a map now but perhaps it is better reverted (or turned into an if let Some(..) = NonNull::new { ...; Some(x) } else { None }).
Must have misread that the
Option
it was assigned to alet
binding rather than returned, while trying to scan for similar patterns that could uselet-else
. Changed it to amap
now but perhaps it is better reverted (or turned into anif let Some(..) = NonNull::new { ...; Some(x) } else { None }
).